sigprocmask() - manipulate current signal mask
#include <signal.h>
int sigprocmask(int how, const sigset_t *set, sigset_t *oset)
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>):
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.
A 0 value indicated that the call succeeded. A -1 return value indicates an error occurred and errno is set to indicated the reason.
The sigprocmask(2) call will fail and the signal mask will be unchanged if one of the following occurs:
kill(2)
sigaction(2)
sigaddset(3)
sigdelset(3)
sigemptyset(3)
sigfillset(3)
sigismember(3)
sigsuspend(2)