sigprocmask(2)


sigprocmask -- change or examine signal mask

Synopsis

   #include <signal.h>
   

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

Description

The sigprocmask function is used to examine and/or change the calling process's signal mask. If the value how is SIG_BLOCK, the set pointed to by the argument set is added to the current signal mask. If the value how is SIG_UNBLOCK, the set pointed by the argument set is removed from the current signal mask. If the value how is SIG_SETMASK, the current signal mask is replaced by the set pointed to by the argument set. If the argument oset is not NULL, the previous mask is stored in the space pointed to by oset. If the value of the argument set is NULL, the value how is not significant and the process's 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 that cannot be ignored [see sigaction(2)]. This restriction is silently imposed by the system.

If sigprocmask fails, the process's signal mask is not changed.

Return values

On success, sigprocmask returns 0. On failure, sigprocmask returns -1 and sets errno to identify the error.

Errors

In the following conditions, sigprocmask fails and sets errno to:

EINVAL
The value of the how argument is not equal to one of the defined values.

EFAULT
The value of set or oset points outside the process's allocated address space.

References

sigaction(2), signal(2), signal(5), sigsetops(3C)

Notices

Considerations for threads programming

Signal masks are maintained per thread. See signal(5) for further details.

Considerations for lightweight processes

Signal masks are internally maintained per LWP. The Threads Library has a wrapper function for this system call to make its effect per thread.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004