1SIGPROCMASK(2) Linux Programmer's Manual SIGPROCMASK(2)
2
3
4
6 sigprocmask - examine and change blocked signals
7
9 #include <signal.h>
10
11 int sigprocmask(int how, const sigset_t *set, sigset_t *oldset);
12
13 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15 sigprocmask(): _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE
16
18 sigprocmask() is used to fetch and/or change the signal mask of the
19 calling thread. The signal mask is the set of signals whose delivery
20 is currently blocked for the caller (see also signal(7) for more
21 details).
22
23 The behavior of the call is dependent on the value of how, as follows.
24
25 SIG_BLOCK
26 The set of blocked signals is the union of the current set and
27 the set argument.
28
29 SIG_UNBLOCK
30 The signals in set are removed from the current set of blocked
31 signals. It is permissible to attempt to unblock a signal which
32 is not blocked.
33
34 SIG_SETMASK
35 The set of blocked signals is set to the argument set.
36
37 If oldset is non-null, the previous value of the signal mask is stored
38 in oldset.
39
40 If set is NULL, then the signal mask is unchanged (i.e., how is
41 ignored), but the current value of the signal mask is nevertheless
42 returned in oldset (if it is not NULL).
43
44 The use of sigprocmask() is unspecified in a multithreaded process; see
45 pthread_sigmask(3).
46
48 sigprocmask() returns 0 on success and -1 on error.
49
51 EINVAL The value specified in how was invalid.
52
54 POSIX.1-2001.
55
57 It is not possible to block SIGKILL or SIGSTOP. Attempts to do so are
58 silently ignored.
59
60 Each of the threads in a process has its own signal mask.
61
62 A child created via fork(2) inherits a copy of its parent's signal
63 mask; the signal mask is preserved across execve(2).
64
65 If SIGBUS, SIGFPE, SIGILL, or SIGSEGV are generated while they are
66 blocked, the result is undefined, unless the signal was generated by
67 the kill(2), sigqueue(2), or raise(3).
68
69 See sigsetops(3) for details on manipulating signal sets.
70
72 kill(2), pause(2), sigaction(2), signal(2), sigpending(2), sigqueue(2),
73 sigsuspend(2), pthread_sigmask(3), sigsetops(3), signal(7)
74
76 This page is part of release 3.22 of the Linux man-pages project. A
77 description of the project, and information about reporting bugs, can
78 be found at http://www.kernel.org/doc/man-pages/.
79
80
81
82Linux 2008-10-17 SIGPROCMASK(2)