sigprocmask()

manipulate signal mask 

Function


SYNOPSIS

#include <signal.h>

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


DESCRIPTION

The sigprocmask() function is used to examine and change the calling process's signal mask.

If how is SIG_BLOCK, the set that the parameter set points to is added to the current signal mask. If it is SIG_UNBLOCK, the set that the parameter set points to is removed from the current signal mask. If it is SIG_SETMASK, the current signal mask is replaced by the set that the parameter set points to.

If oset is not NULL, it returns the previous mask. If set is NULL, the value how is not significant and the signal mask of the process remains unchanged. Therefore, you can use the call to inquire about currently blocked signals.

If there are any pending unblocked signals after the call to sigprocmask(), at least one of those signals is delivered before the call to sigprocmask() returns.

It is not possible to block those signals that cannot be ignored (see sigaction()). The system silently imposes this restriction.

If sigprocmask() is called in a signal handler, returning from the handler may undo the work of sigprocmask() by restoring the original pending signal mask.


PARAMETERS

how 

Indicates the type of change.

set 

Points to the new set.

oset 

Is a return pointer to the old set.


RETURN VALUES

If successful, sigprocmask() returns a zero. On failure, it returns -1, does not change the signal mask of the process, and sets errno to one of the following values:

EFAULT 

set or oset is an invalid pointer.

EINVAL 

how is not a valid value.


CONFORMANCE

POSIX.1 (1996).


MULTITHREAD SAFETY LEVEL

Async-signal-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:
pthread_sigmask(), sigaction(), sigaddset(), sigdelset(), sigemptyset(), sigfillset(), sigismember(), signal(), sigpending(), sigsuspend()


PTC MKS Toolkit 10.4 Documentation Build 39.