Chapter 7. Signal Handling <signal.h>

Table of Contents
7.1. Specify Signal Handling
7.2. Send Signal

The header <signal.h> declares a type and two functions and defines several macros for handling various signals (conditions that may be reported during program execution).

The type defined is

sig_atomic_t

which is the integral type of an object that can be access as an atomic entity, even in the presence of asynchronous interrupts.

The macros defined are:

SIG_DFL

SIG_ERR

SIG_IGN

which expand to constant expressions with distinct values that are type compatible with the second argument to and the return value of the signal function, and whose value compares unequal to the address of any declarable function; and the following, each of which expands to a positive integral constant expression that is the signal number corresponding to the specified condition.

SIGHUP Hangup (POSIX).
SIGINT Interrupt (ANSI).
SIGQUIT Quit (POSIX).
SIGILL Illegal instruction (ANSI).
SIGABRT Abort (ANSI).
SIGTRAP Trace trap (POSIX).
SIGIOT IOT trap (4.2 BSD).
SIGEMT EMT trap (4.2 BSD).
SIGFPE Floating-point exception (ANSI).
SIGKILL Kill, unblock-able (POSIX).
SIGBUS Bus error (4.2 BSD).
SIGSEGV Segmentation violation (ANSI).
SIGSYS Bad argument to system call (4.2 BSD)
SIGPIPE Broken pipe (POSIX).
SIGALRM Alarm clock (POSIX).
SIGTerm Termination (ANSI).
SIGUSR1 User-defined signal 1 (POSIX).
SIGUSR2 User-defined signal 2 (POSIX).
SIGCHLD Child status has changed (POSIX).
SIGCLD Same as SIGCHLD (System V).
SIGPWR Power failure restart (System V).

7.1. Specify Signal Handling

Table of Contents
The signal function --