From 91d4927d0609c1dc92645fe4011e036418afbf2c Mon Sep 17 00:00:00 2001 From: Ken Thompson Date: Mon, 5 Nov 1973 21:16:53 -0500 Subject: [PATCH] Research V4 development Work on file man/man2/signal.2 Co-Authored-By: Dennis Ritchie Synthesized-from: v4 --- man/man2/signal.2 | 104 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 man/man2/signal.2 diff --git a/man/man2/signal.2 b/man/man2/signal.2 new file mode 100644 index 0000000000..cfc1c6f961 --- /dev/null +++ b/man/man2/signal.2 @@ -0,0 +1,104 @@ +.th SIGNAL II 8/5/73 +.sh NAME +signal \*- catch or ignore signals +.sh SYNOPSIS +(signal = 48.) +.br +.ft B +sys signal; sig; value +.s3 +signal(sig, func) +.br +int (*func)(); +.ft R +.sh DESCRIPTION +When the signal +defined by +.it sig +is sent to the current process, +it is to be treated according to +.it value. +The following is the list of signals: +.s3 +.lp +10 5 +1 hangup +.lp +10 5 +2 interrupt +.lp +10 5 +3* quit +.lp +10 5 +4* illegal instruction +.lp +10 5 +5* trace trap +.lp +10 5 +6* IOT instruction +.lp +10 5 +7* EMT instruction +.lp +10 5 +8* floating point exception +.lp +10 5 +9 kill (cannot be caught or ignored) +.lp +10 5 +10* bus error +.lp +10 5 +11* segmentation violation +.lp +10 5 +12* bad argument to sys call +.s3 +.i0 +If +.it value +is 0, the default system +action applies to the signal. +This is processes termination +with or without a core dump. +If +.it value +is odd, the signal is ignored. +Any other even +.it value +specifies an address in the process +where an interrupt is simulated. +An RTI instruction will return from the +interrupt. +As a signal is caught, +it is reset to 0. +Thus if it is desired to +catch every such signal, +the catching routine must +issue another +.it signal +call. +.s3 +The starred signals in the list above +cause core images if not caught and not ignored. +In C, +if +.it func +is 0 or 1, the action is as described above. +If +.it func +is even, it is assumed to be the address +of a function entry point. +When the signal occurs, +the function will be called. +A return from the function will +simulate the RTI. +.s3 +After a +.it fork, +the child inherits +all signals. +The +.it exec +call resets all +caught signals to default action. +.sh "SEE ALSO" +kill (I, II) +.sh DIAGNOSTICS +The error bit +(c-bit) +is set if the +given signal is out of range. +In C, a \*-1 indicates an error; +0 indicates success. -- 2.20.1