SIGPROCMASK(2)
NAME
sigprocmask − examine and change blocked signals
SYNOPSIS
#include <signal.h>
int sigprocmask ( how, set, oset )
int how ;
sigset_t *set, *oset ;
DESCRIPTION
Sigprocmask allows the calling process to examine and/or change its signal mask.
Unless it is a null pointer, the argument set points to a set of signals to be used to change the currently blocked set.
The argument how indicates how the set is changed, and consists of one of the following values (see <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 the argument oset is not a null pointer, the previous signal mask is stored in the location pointed to by oset. If set is a null pointer, the value of the argument how is insignificant and the process’s signal mask is unchanged; thus the call can be used to inquire about currently blocked signals.
If any pending unblocked signals remain after the call to sigprocmask, at least one of those signals is delivered before the call to sigprocmask returns.
It is impossible to block the SIGKILL or SIGSTOP signal. This is enforced by the system without causing an error to be indicated.
The process’s signal mask is not changed if sigprocmask fails for any reason.
RETURN VALUE
Upon successful completion, sigprocmask returns a value of 0. Otherwise a value of −1 is returned and errno is set to indicate the error.
ERRORS
Sigprocmask fails if one or more of the following is true:
[EINVAL] The value of the how argument is not equal to one of the defined values.
[EFAULT] Set or oset points to an invalid address. The reliable detection of this error is implementation dependent.
AUTHOR
Sigprocmask was derived from the IEEE Standard POSIX 1003.1-1988.
SEE ALSO
sigaction(2), sigsuspend(2), sigpending(2), sigsetops(3C), signal(5).
STANDARDS CONFORMANCE
sigprocmask: XPG3, POSIX.1, FIPS 151-1
Hewlett-Packard Company — HP-UX Release 7.0: Sept 1989