signal \- catch or ignore signals
int (*signal(sig, func))()
\fBThis interface is obsolete and will be replaced in the 4.2 release
by an interface compatible with signal(3J) and sigsys(2).\fP
allows the calling process to choose how it will handle
the receipt of a specific signal.
is generated by some abnormal event,
initiated either by user at a terminal (quit, interrupt),
by a program error (bus error, etc.),
or by request of another program (kill).
cause termination of the receiving process,
call allows them either to be ignored
or to cause an interrupt to a specified location.
Here is the list of signals with names as in
.ta \w'SIGVTALRM 'u +\w'15* 'u
SIGILL 4* illegal instruction (not reset when caught)
SIGTRAP 5* trace trap (not reset when caught)
SIGIOT 6* IOT instruction
SIGEMT 7* EMT instruction
SIGFPE 8* floating point exception
SIGKILL 9 kill (cannot be caught or ignored)
SIGSEGV 11* segmentation violation
SIGSYS 12* bad argument to system call
SIGPIPE 13 write on a pipe with no one to read it
SIGTERM 15 software termination signal
SIGURG 16 urgent condition pending
SIGSTOP 17 stop (cannot be caught, held or ignored)
SIGTSTP 18 stop signal generated from keyboard
SIGCONT 19 continue after stop
SIGCHLD 20 child status has changed
SIGTTIN 21 background read attempted from control terminal
SIGTTOU 22 background write attempted to control terminal
SIGIO 23 i/o is possible on a descriptor (see \fIsetdopts\fP(2))
SIGXCPU 24 cpu time limit exceeded (see \fIsetrlimit\fP(2))
SIGXFSZ 25 file size limit exceeded (see \fIsetrlimit\fP(2))
SIGVTALRM 26 virtual time alarm (see \fIsetitimer\fP(2))
SIGPROF 27 profiling timer alarm (see \fIsetitimer\fP(2))
Signal numbers 1, 2, 4, and 9 may be referred to by
their absolute decimal values. All other signals should be
referred to symbolically.
The starred signals in the list above cause a core image
if not caught or ignored.
is SIG_DFL, the default action
is reinstated; this default is termination,
sometimes with a core image.
is SIG_IGN the signal is ignored.
signal number as argument.
A return from the function will
continue the process at the point it was interrupted.
a signal is reset to SIG_DFL after being caught.
the catching routine must
If, when using this (older) signal interface,
during certain system calls, the call terminates prematurely.
In particular this can occur
on a slow device (like a terminal; but not a file);
When such a signal occurs, the saved user status
is arranged in such a way that when return from the
signal-catching takes place, it will appear that the
system call returned an error status EINTR.
The user's program may then, if it wishes,
is the previous (or initial)
for the particular signal.
caught signals to default action.
Upon successful completion,
returns the previous value of
Otherwise, a value of \-1
is set to indicate the error.
will fail if one or more of the following are true:
\fISig\fP is an illegal signal number,
\fIFunc\fP points to an illegal address.
function is not recommended for use as an interprocess
communications mechanism.
The value (int)\-1 is returned if the
given signal is out of range.
The traps should be distinguishable by extra arguments
to the signal handler, and all hardware supplied parameters should
be made available to the signal routine.
If a repeated signal arrives before the last one can be
reset, there is no chance to catch it
The type specification of the routine and its
argument are problematical.