sigprocmask(2)
NAME
sigprocmask − examine and change blocked signals
SYNOPSIS
#include <signal.h>
int sigprocmask(
int how,
const sigset_t *set,
sigset_t *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 0; otherwise it returns −1 and sets errno to indicate the error.
ERRORS
sigprocmask() fails if any of the following conditions are encountered:
[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 POSIX 1003.1-1988 Standard.
SEE ALSO
sigaction(2), sigsuspend(2), sigpending(2), sigsetops(3C), signal(5).
STANDARDS CONFORMANCE
sigprocmask(): AES, XPG3, XPG4, FIPS 151-2, POSIX.1
Hewlett-Packard Company — HP-UX Release 9.0: August 1992