1PTHREAD_SIGMASK(3P) POSIX Programmer's Manual PTHREAD_SIGMASK(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 pthread_sigmask, sigprocmask - examine and change blocked signals
13
15 #include <signal.h>
16
17
18
19 int pthread_sigmask(int how, const sigset_t *restrict set,
20 sigset_t *restrict oset);
21
22
23 int sigprocmask(int how, const sigset_t *restrict set,
24 sigset_t *restrict oset);
25
26
28 The pthread_sigmask() function shall examine or change (or both) the
29 calling thread's signal mask, regardless of the number of threads in
30 the process. The function shall be equivalent to sigprocmask(), without
31 the restriction that the call be made in a single-threaded process.
32
33 In a single-threaded process, the sigprocmask() function shall examine
34 or change (or both) the signal mask of the calling thread.
35
36 If the argument set is not a null pointer, it points to a set of sig‐
37 nals to be used to change the currently blocked set.
38
39 The argument how indicates the way in which the set is changed, and the
40 application shall ensure it consists of one of the following values:
41
42 SIG_BLOCK
43 The resulting set shall be the union of the current set and the
44 signal set pointed to by set.
45
46 SIG_SETMASK
47 The resulting set shall be the signal set pointed to by set.
48
49 SIG_UNBLOCK
50 The resulting set shall be the intersection of the current set
51 and the complement of the signal set pointed to by set.
52
53
54 If the argument oset is not a null pointer, the previous mask shall be
55 stored in the location pointed to by oset. If set is a null pointer,
56 the value of the argument how is not significant and the process' sig‐
57 nal mask shall be unchanged; thus the call can be used to enquire about
58 currently blocked signals.
59
60 If there are any pending unblocked signals after the call to sigproc‐
61 mask(), at least one of those signals shall be delivered before the
62 call to sigprocmask() returns.
63
64 It is not possible to block those signals which cannot be ignored.
65 This shall be enforced by the system without causing an error to be
66 indicated.
67
68 If any of the SIGFPE, SIGILL, SIGSEGV, or SIGBUS signals are generated
69 while they are blocked, the result is undefined, unless the signal was
70 generated by the kill() function, the sigqueue() function, or the
71 raise() function.
72
73 If sigprocmask() fails, the thread's signal mask shall not be changed.
74
75 The use of the sigprocmask() function is unspecified in a multi-
76 threaded process.
77
79 Upon successful completion pthread_sigmask() shall return 0; otherwise,
80 it shall return the corresponding error number.
81
82 Upon successful completion, sigprocmask() shall return 0; otherwise, -1
83 shall be returned, errno shall be set to indicate the error, and the
84 process' signal mask shall be unchanged.
85
87 The pthread_sigmask() and sigprocmask() functions shall fail if:
88
89 EINVAL The value of the how argument is not equal to one of the defined
90 values.
91
92
93 The pthread_sigmask() function shall not return an error code of
94 [EINTR].
95
96 The following sections are informative.
97
99 None.
100
102 None.
103
105 When a process' signal mask is changed in a signal-catching function
106 that is installed by sigaction(), the restoration of the signal mask on
107 return from the signal-catching function overrides that change (see
108 sigaction()). If the signal-catching function was installed with sig‐
109 nal(), it is unspecified whether this occurs.
110
111 See kill() for a discussion of the requirement on delivery of signals.
112
114 None.
115
117 sigaction(), sigaddset(), sigdelset(), sigemptyset(), sigfillset(),
118 sigismember(), sigpending(), sigqueue(), sigsuspend(), the Base Defini‐
119 tions volume of IEEE Std 1003.1-2001, <signal.h>
120
122 Portions of this text are reprinted and reproduced in electronic form
123 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
124 -- Portable Operating System Interface (POSIX), The Open Group Base
125 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
126 Electrical and Electronics Engineers, Inc and The Open Group. In the
127 event of any discrepancy between this version and the original IEEE and
128 The Open Group Standard, the original IEEE and The Open Group Standard
129 is the referee document. The original Standard can be obtained online
130 at http://www.opengroup.org/unix/online.html .
131
132
133
134IEEE/The Open Group 2003 PTHREAD_SIGMASK(3P)