From: Jay Lepreau Date: Mon, 16 Feb 1987 08:16:44 +0000 (-0800) Subject: date and time created 87/02/15 16:16:44 by lepreau X-Git-Tag: BSD-4_3-Snapshot-Development~73 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/3084bb00400b4f62d67f556b806beb7bf9124942 date and time created 87/02/15 16:16:44 by lepreau SCCS-vsn: local/sccscmds/sccscmds.2/util/setsig.c 1.1 SCCS-vsn: local/sccscmds/sccscmds.ok/util/setsig.c 1.1 --- diff --git a/usr/src/local/sccscmds/sccscmds.2/util/setsig.c b/usr/src/local/sccscmds/sccscmds.2/util/setsig.c new file mode 100644 index 0000000000..5cecb1b2c0 --- /dev/null +++ b/usr/src/local/sccscmds/sccscmds.2/util/setsig.c @@ -0,0 +1,85 @@ +# include "signal.h" +#undef NSIG +# ifdef PWB +#define NSIG 16 +# else +#define NSIG 4 +# endif +# include "../hdr/macros.h" +SCCSID(@(#)setsig 2.1); + +/* + General-purpose signal setting routine. + All non-ignored, non-caught signals are caught. + If a signal other than hangup, interrupt, or quit is caught, + a "user-oriented" message is printed on file descriptor 2 with + a number for help(I). + If hangup, interrupt or quit is caught, that signal + is set to ignore. + Termination is like that of "fatal", + via "clean_up(sig)" (sig is the signal number) + and "exit(userexit(1))". + + If the file "dump.core" exists in the current directory + the function commits + suicide to produce a core dump + (after calling clean_up, but before calling userexit). +*/ + + +char *Mesg[NSIG] { + 0, + 0, /* Hangup */ + 0, /* Interrupt */ + 0, /* Quit */ +# ifdef PWB + "Illegal instruction", + "Trace/BPT trap", + "IOT trap", + "EMT trap", + "Floating exception", + "Killed", + "Bus error", + "Memory fault", + "Bad system call", + "Broken pipe", + "Alarm clock", + "Terminated" +# endif PWB +}; + + +setsig() +{ + extern int setsig1(); + register int j, n; + + for (j=1; j 0) { + signal(SIGIOT,0); + abort(); + } + exit(userexit(1)); +} diff --git a/usr/src/local/sccscmds/sccscmds.ok/util/setsig.c b/usr/src/local/sccscmds/sccscmds.ok/util/setsig.c new file mode 100644 index 0000000000..5cecb1b2c0 --- /dev/null +++ b/usr/src/local/sccscmds/sccscmds.ok/util/setsig.c @@ -0,0 +1,85 @@ +# include "signal.h" +#undef NSIG +# ifdef PWB +#define NSIG 16 +# else +#define NSIG 4 +# endif +# include "../hdr/macros.h" +SCCSID(@(#)setsig 2.1); + +/* + General-purpose signal setting routine. + All non-ignored, non-caught signals are caught. + If a signal other than hangup, interrupt, or quit is caught, + a "user-oriented" message is printed on file descriptor 2 with + a number for help(I). + If hangup, interrupt or quit is caught, that signal + is set to ignore. + Termination is like that of "fatal", + via "clean_up(sig)" (sig is the signal number) + and "exit(userexit(1))". + + If the file "dump.core" exists in the current directory + the function commits + suicide to produce a core dump + (after calling clean_up, but before calling userexit). +*/ + + +char *Mesg[NSIG] { + 0, + 0, /* Hangup */ + 0, /* Interrupt */ + 0, /* Quit */ +# ifdef PWB + "Illegal instruction", + "Trace/BPT trap", + "IOT trap", + "EMT trap", + "Floating exception", + "Killed", + "Bus error", + "Memory fault", + "Bad system call", + "Broken pipe", + "Alarm clock", + "Terminated" +# endif PWB +}; + + +setsig() +{ + extern int setsig1(); + register int j, n; + + for (j=1; j 0) { + signal(SIGIOT,0); + abort(); + } + exit(userexit(1)); +}