System Interface Guide

Signal Processing

When a signal is delivered to a process, it is added to a set of signals pending for the process. If the signal is not blocked for the process, it is delivered. When a signal is delivered, the current state of the process is saved, a new signal mask is calculated, and the signal handler is invoked.

In BSD signal semantics, when a signal is delivered to a process, a new signal mask is installed for the duration of the process's signal handler (or until a mask modifying interface is called). This mask blocks the signal that has just been delivered from interrupting the process again while the handler for the signal is running.

System V signal semantics do not provide this protection, letting the same signal interrupt the handler that processes the signal. This requires that a signal handler be reentrant.

All signals have the same priority. If a signal handler blocks the signal that invoked it, other signals can still be delivered to the process.

Signals are not stacked. There is no way for a signal handler to record how many times a signal has actually been delivered.