The <signal.h>
header file declares a type and
two functions and defines several macros for handling exception
conditions that might be reported during program execution.
sig_atomic_t
SIG_DFL
SIG_ERR
SIG_IGN
signal
function, and whose value
compares unequal to the address of any declarable function.
void (*signal(int sig, void (*handler) (int))) (int);
handler
is SIG_
DFL
, default handling of that signal occurs.
handler
is SIG_
IGN
, the signal is ignored.
handler
is called with the argument of
the type of signal. Such a function is called a signal
handler. Valid signals include:
abort
function
Any other signals are operating-system dependent.
If the request can be honored, the signal
function
returns the value of handler
for the most
recent call to signal
for the specified signal
sig
. Otherwise, a value of SIG_ERR
is
returned and an implementation-defined positive value is stored
in errno
.
int raise(int sig);
sig
to the executing program.
The raise
function returns 0 if successful and
nonzero if unsuccessful.