A signal is a very short message that may be sent to a process or a group of processes. The only information given to the process is usually a number identifying the signal; there is no room in standard signals for arguments, a message, or other accompanying information.
A set of macros whose names start with the prefix
SIG is used to identify signals; we have
already made a few references to them in previous chapters. For
SIGCHLD macro was
mentioned in the section "The clone( ), fork( ), and vfork(
) System Calls" in Chapter
3. This macro, which expands into the value 17 in Linux, yields
the identifier of the signal that is sent to a parent process when a
child stops or terminates. The
SIGSEGV macro, which expands into the value
11, was mentioned in the section "Page Fault Exception Handler"
in Chapter 9; it yields the
identifier of the signal that is sent to a process when it makes an
invalid memory reference.
Signals serve two main purposes:
To make a process aware that a specific event has occurred
To cause a process to execute a signal handler function included in its code
Of course, the two purposes are not mutually exclusive, because often a process must react to some event by executing a specific routine.
lists the first 31 signals handled by Linux 2.6 for the 80×86
architecture (some signal numbers, such those associated with
SIGSTOP, are architecture-dependent; furthermore, some signals such as ...