sigblock, sigmask, sigpause, sigsetmask - block signals
sigblock() adds the signals specified in mask to the set of signals currently being blocked from delivery. Signals are blocked if the appropriate bit
in mask is a 1; the macro sigmask is provided to construct the mask for a given signum. sigblock() returns the
previous mask. The previous mask may be restored using sigsetmask().
sigpause() assigns mask to the set of masked signals and then waits for a signal to arrive; on return the set of masked signals is restored. mask is usually 0 to indicate that no signals are now to be blocked. sigpause() always terminates by being interrupted, returning -1 and setting errno
to EINTR.
sigsetmask() sets the current signal mask (those signals that are blocked from delivery). Signals are blocked if the corresponding bit in mask is a 1;
the macro sigmask is provided to construct the mask for a given signum.
In normal usage, a signal is blocked using sigblock(). To begin a critical section, variables modified on the occurrence of the signal are examined to determine that there is no
work to be done, and the process pauses awaiting work by using sigpause() with the mask returned by sigblock().
It is not possible to block SIGKILL, SIGSTOP, or SIGCONT, this restriction
is silently imposed by the system.
|