.TH SIGNAL 3F "18 July 1983"
signal \- change the action for a signal
.B integer function signal(signum, proc, flag)
When a process incurs a signal (see
is usually to clean up and abort.
The user may choose to write an alternative signal handling routine.
is the way this alternate action is specified to the system.
is the signal number (see
must be the name of the user signal handling routine.
is zero or positive, then
is ignored and the value of
is passed to the system as the signal action definition.
In particular, this is how previously saved signal actions can be restored.
0 means "use the default action" (See NOTES below),
1 means "ignore this signal".
A positive returned value is the previous action definition.
A value greater than 1 is the address of a routine that
was to have been called on occurrence of the given signal.
The returned value can be used in subsequent calls to
in order to restore a previous action definition.
A negative returned value is the negation of a system error code.
.ie \nM /usr/ucb/lib/libU77.a
signal(3C), kill(3F), kill(1)
arranges to trap certain signals when a process is started.
The only way to restore the default
action is to save the returned
value from the first call to
If the user signal handler is called, it will be passed the signal number