NEXT UP previous
 

Next: signal System Call

Signals

Signals is the mechanism by which processes are made aware of events occurring in the system. An important feature of signals is that they are asynchronous, which means that a process may receive a signal at any time during its execution, and must be prepared to respond to the signal at that time. It is even possible for a process to receive a signal while it is executing a system call. Generally, if a system call is interrupted by a signal, then it will return its error value and set errno to the value EINTR. It is then the responsibility of the signaled process to re-try the interrupted call.

Each of the signal types, of which there are currently thirty odd, is given a symbolic name accessed via the <signal.h> header file. The most common signal values and their symbolic names are:

valuesymbolpurpose
1SIGHUPhangup on control terminal
2SIGINTinterrupt from keyboard (Ctrl-c)
3SIGQUITquit from keyboard (Ctrl-\)
8SIGFPEfloating point exception (e.g. divide by 0)
9SIGKILLterminate receiving process
14SIGALRMend of alarm() system call timeout
15SIGTERMdefault kill command signal
17SIGCHLDchild process stopped or terminated
19SIGSTOPstop execution from keyboard Ctrl-z

Each signal type has associated with it an action which the kernel will perform on behalf of a process when the process is sent that signal. For most of the signals, the default action is to terminate the receiving process, though, usually, a process can request some alternative action of the system. The various alternatives are:


NEXT UP previous
Next: signal System Call