[Previous] [Contents] [Next]

pthread_sigmask()

Examine and change blocked signals

Synopsis:

#include <signal.h>

int pthread_sigmask( int how,
                     const sigset_t* set,
                     sigset_t* oset );

Library:

libc

Description:

The pthread_sigmask() function is used to examine and/or change the calling thread's signal mask. If set is non-NULL, the thread's signal mask is set to set. If oset is non-NULL, the thread's old signal mask is returned in oset.

The value of how indicates the manner in which the signal mask is changed, as defined below, and is only valid if set is non-NULL.

Value Description
SIG_BLOCK The resulting signal mask is the union of the current signal mask and the signal set set.
SIG_UNBLOCK The resulting signal mask is the intersection of the current signal mask and the complement of the signal set set.
SIG_SETMASK The resulting signal mask is the signal set set.

The SIGKILL and SIGSTOP signals cannot be blocked.

Returns:

EOK
Success.
EINVAL
Invalid how parameter.

Classification:

POSIX 1003.1 (Threads)

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

sigprocmask()


[Previous] [Contents] [Next]