SIGPROCMASK(2V)

NAME
sigprocmask - examine and change blocked signals

SYNOPSIS

#include <signal.h>

int sigprocmask(how, set, oset)
int how;
sigset_t *set, *oset;

DESCRIPTION

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 <signal.h>:

    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 current set and the complement of the signal set pointed to by set.

    SIG_SETMASK
        The resulting set is the signal set pointed to by set.

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 significant and the process's signal mask is unchanged by this function call. Thus, the call can be used to enquire about currently blocked signals.

If there are any pending unblocked signals after the call to sigprocmask(), at least one of those signals is be delivered before sigprocmask() returns.

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 generated by a call to kill(2V).

If sigprocmask() fails, the process's signal mask is not changed.

RETURN VALUES

sigprocmask() returns:

0   on success.

-1  on failure and sets errno to indicate the error.

ERRORS

EINVAL
    The value of how is not equal to one of the defined values.

SEE ALSO
sigpause(2V), sigpending(2V), sigvec(2), sigaction(3V), sigsetops(3V)