sigprocmask()

NAME

sigprocmask() - manipulate current signal mask

SYNOPSIS

#include <signal.h>

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

DESCRIPTION

The sigprocmask(2) function examines and/or changes the current signal mask (those signals that are blocked from delivery). Signals that belong to the current signal mask set are blocked.

The oset argument is set by the call to the previous value of the signal mask. If it is set to NULL, it is ignored.

The set argument points to a signal set that describes the changes to be made to the process's signal mask. If set is NULL, the mask isn't changed.

The how argument describes the change being requested (these values are defined in <signal.h>):

SIG_BLOCK
The new mask is the union of the current mask and the specified set.
SIG_UNBLOCK
The new mask is the intersection of the current mask and the complement of the specified set.
SIG_SETMASK
The current mask is replaced by the specified set.

If set is NULL, how is ignored. You can examine the current signal set by using NULL for set and loading the current signal set into oset.

You cannot block SIGKILL or SIGSTOP.

RETURN VALUES

A 0 value indicated that the call succeeded. A -1 return value indicates an error occurred and errno is set to indicated the reason.

ERRORS

The sigprocmask(2) call will fail and the signal mask will be unchanged if one of the following occurs:

[EINVAL]
how has a value other than those listed here.

SEE ALSO

kill(2)

sigaction(2)

sigaddset(3)

sigdelset(3)

sigemptyset(3)

sigfillset(3)

sigismember(3)

sigsuspend(2)