NAME
pthread_sigmask() — examine/change signal mask of calling thread
SYNOPSIS
#include <pthread.h>
int pthread_sigmask(
int how,
const sigset_t *__restrict set,
sigset_t *__restrict oset
);
PARAMETERS
- how
This parameter defines how the signal mask of the calling thread will be
changed.
- set
Pointer to the set of signals that will be used to change the currently
blocked signal set.
- oset
Pointer to where the previous signal mask will be returned.
DESCRIPTION
pthread_sigmask()
allows the calling thread to examine and/or change its signal mask.
Unless it is a null pointer, the argument
set
points to a set of signals which are to be used
to change the currently blocked signal set.
The argument
how
indicates how the set is changed.
The legal values are:
- 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 returned in
oset.
If
set
is a null pointer, the value of the argument
how
is insignificant and the thread's signal mask is unchanged;
thus, the call can be used to inquire about currently blocked signals.
If there any pending unblocked signals after the call to
pthread_sigmask(),
at least one of those signals is delivered before the call to
pthread_sigmask()
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 thread's signal mask is not changed if
pthread_sigmask()
fails for any reason.
RETURN VALUE
Upon successful completion,
pthread_sigmask()
returns zero.
Otherwise, an error number is returned to indicate the error
(the
errno
variable is not set).
ERRORS
If any of the following occur, the
pthread_sigmask()
function returns the corresponding error number:
- EINVAL
how
contains an invalid value.
- EFAULT
set
or
oset
points to an invalid address.
The reliable detection of this error is implementation dependent.
AUTHOR
pthread_sigmask()
was derived from the IEEE POSIX P1003.1c standard.
STANDARDS CONFORMANCE
pthread_sigmask(): POSIX 1003.1c.