pthread_sigmask()

change thread signal mask 

Function


SYNOPSIS

#include <pthread.h>

#include <signal.h>

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


DESCRIPTION

The pthread_sigmask() function is used to examine and change the signal mask for the calling thread. If the argument set is non-NULL, it points to a set of signals to be used to change the currently blocked set. The argument how indicates the way in which the set is changed, and consists of one of the following values:

SIG_BLOCK  

The resulting set is the union of the current set and the specified signal set.

SIG_SETMASK  

The resulting set is the specified signal set.

SIG_UNBLOCK  

The resulting set is the intersection of the current set and the complement of the specified signal set.

If the argument oset is non-NULL, the previous mask is stored in the specified location. If set is NULL, the value of argument how is not significant and the thread's signal mask is unchanged. This can be used to determine the current signal mask without altering it.

If there are 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 not possible to block those signals that cannot be ignored. This is enforced by the system without causing an error to be indicated.

If any of the SIGFPE, SIGILL, SIGSEGV, or SIGBUS signals are generated while they are blocked, the result is undefined, unless the signal was generated by a function capable of sending a signal to a specific process or thread.


PARAMETERS

how 

Specifies how the new signal mask parameter is to be combined with the current signal mask; one of the values specified above.

set 

Is the new signal mask to be combined with the current signal mask. This parameter can be NULL, in which case the signal mask is not modified, and the existing signal mask may be returned in oset.

oset 

Is the location where the current signal mask is stored. This can be NULL if the current signal mask is not required.


RETURN VALUES

On success, pthread_sigmask() returns 0. On error, one of the following values is returned:

EINVAL 

how does not specify a valid value.

EFAULT 

set or oset is an invalid pointer.


CONFORMANCE

POSIX P1003.1 (1996)


MULTITHREAD SAFETY LEVEL

MT-safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
kill(), sigaction(), sigaddset(), sigdelset(), sigemptyset(), sigfillset(), sigismember(), signal(), sigpending(), sigprocmask(), sigsuspend()


PTC MKS Toolkit 10.2 Documentation Build 28.