|
|
#include <signal.h>int sigprocmask (how, set, oset) int how; sigset_t *set, *oset;
The signal mask of a process is initialized to that of its parent by fork(S-osr5). The mask is changed by the sigprocmask, sigaction(S-osr5), and sigsuspend(S-osr5) routines. The contents of a mask are manipulated by the sigset(S-osr5) routines.
The argument, how, dictates how the current signal mask is changed. As defined in the header file, <signal.h>, the following options are allowable:
Name | Description |
---|---|
SIG_BLOCK | The resulting set is the union of the current set and the set to which the argument set points (signals in set are added to the existing set). |
SIG_UNBLOCK | The resulting set is the intersection of the current set and the complement of the set to which the argument set points (signals in set are removed from the existing set). |
SIG_SETMASK | The resulting set is the set to which the argument set points. |
If the argument set is not NULL, it points to the signal set that will be used to change the current signal mask, depending on the value of the argument how. If the argument set is NULL, the value of how is immaterial and the process's signal mask remains unchanged by the routine. In this latter case, the routine can be used to enquire about currently blocked signals.
If the argument oset is not NULL, the previous mask is stored in the object to which the argument oset points.
If any pending unblocked signals exist after the call to this routine, at least one of those signals is delivered before the sigprocmask routine returns.
Generation of the SIGFPE, SIGILL, or SIGSEGV signals while they are blocked yields an undefined result unless the signal was generated by a call to the raise(S-osr5) or kill(S-osr5) routines.
Un-ignorable signals, described on the signal(M) manual page cannot be blocked. The system automatically enforces this restriction without indicating an error.
IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1)
;
X/Open Portability Guide, Issue 3, 1989
;
and
NIST FIPS 151-1
.