Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

sigprocmask - examine or change blocked signals

&pagelevel(4)&pagelevel

Syntax

#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, i.e. the set of blocked signals.

If set is not a null pointer, it points to a set of signals to be used to change the currently blocked set.

how indicates the way in which the set is to be changed, and can assume of one of the following values (see also signal.h):

SIG_BLOCK

The resulting set will be the union of the current set and the signal set specified by set.

SIG_UNBLOCK

The resulting set will be the intersection of the current set and the complement of the signal set specified by set. The resulting set will be the signal set pointed to by set.

SIG_SETMASK

The resulting set will correspond to the signal set specified by set.

If oset is not a null pointer, the previous mask is stored in the location pointed to by oset.

If set is a null pointer, the value of the argument how is not significant and the process signal mask is unchanged; thus the call can be used to enquire about currently blocked signals.

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

It is not possible to block those signals which cannot be ignored (see signal.h). This is enforced by the system without causing an error to be indicated.

If any of the SIGFPE, SIGILL or SIGSEGV signals are generated while they are blocked, the result is undefined, unless the signal was generated by a call to kill() or raise().

If sigprocmask() fails, the process signal mask is not changed.

sigprocmask() is not thread-safe. Use the function pthread_sigmask() when needed.

Return val.

0

if successful.


-1

if an error occurs. errno is set to indicate the error. The process signal mask is not changed.

Errors

sigprocmask() will fail if:

 

EINVAL

The value of how does not correspond to any of permitted value.

 

Extension

 

EFAULT

set or oset points beyond the allocated process address space. (End)

Siehe auch

kill(), raise(), sigaction(), sigaddset(), sigdelset(), sigemptyset(), sigfillset(), sigismember(), sigpending(), sigsuspend(), signal.h.