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. In the event of an
49 error, errno is set to indicate the cause.
50
52 EFAULT the set or oldset argument points outside the process's allo‐
53 cated address space.
54
55 EINVAL The value specified in how was invalid.
56
58 POSIX.1-2001.
59
61 It is not possible to block SIGKILL or SIGSTOP. Attempts to do so are
62 silently ignored.
63
64 Each of the threads in a process has its own signal mask.
65
66 A child created via fork(2) inherits a copy of its parent's signal
67 mask; the signal mask is preserved across execve(2).
68
69 If SIGBUS, SIGFPE, SIGILL, or SIGSEGV are generated while they are
70 blocked, the result is undefined, unless the signal was generated by
71 kill(2), sigqueue(3), or raise(3).
72
73 See sigsetops(3) for details on manipulating signal sets.
74
76 kill(2), pause(2), sigaction(2), signal(2), sigpending(2), sigsus‐
77 pend(2), pthread_sigmask(3), sigqueue(3), sigsetops(3), signal(7)
78
80 This page is part of release 3.53 of the Linux man-pages project. A
81 description of the project, and information about reporting bugs, can
82 be found at http://www.kernel.org/doc/man-pages/.
83
84
85
86Linux 2013-04-19 SIGPROCMASK(2)