sigprocmask - examine and change blocked signals
int sigprocmask(how, set, oset)
sigset_t *set, *oset;
sigprocmask() is used to examine or change (or both) the calling
process's signal mask. If the value of set is not NULL, it points to a
set of signals to be used to change the currently blocked set.
The value of how indicates the manner in which the set is changed, and
consists of one of the following values, as defined in the header <<sig-
SIG_BLOCK The resulting set is the union of the current set
and the signal set pointed to by set.
SIG_UNBLOCK The resulting set is the intersection of the cur-
rent set and the complement of the signal set
pointed to by set.
SIG_SETMASK The resulting set is the signal set pointed to by
If oset is not NULL, the previous mask is stored in the space pointed
to by oset. If the value of set is NULL, the value of how is not sig-
nificant and the process's signal mask is unchanged by this function
call. Thus, the call can be used to enquire about currently blocked
If there are any pending unblocked signals after the call to sigproc-
mask(), at least one of those signals is be delivered before sigproc-
If it is not possible to block the SIGKILL and SIGSTOP signals. This
is enforced by the system without causing an error to be indicated.
If any of the SIGFPE, SIGKILL, or SIGSEGV signals are generated while
they are blocked, the result is undefined, unless the signal was gener-
ated by a call to kill(2V).
If sigprocmask() fails, the process's signal mask is not changed.
0 on success.
-1 on failure and sets errno to indicate the error.
EINVAL The value of how is not equal to one of the defined val-
sigpause(2V), sigpending(2V), sigvec(2), sigaction(3V), sigsetops(3V)
21 January 1990 SIGPROCMASK(2V)