]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3p/sigprocmask.3p
Import of man-pages 1.70
[thirdparty/man-pages.git] / man3p / sigprocmask.3p
1 .\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
2 .TH "PTHREAD_SIGMASK" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
3 .\" pthread_sigmask
4 .SH NAME
5 pthread_sigmask, sigprocmask \- examine and change blocked signals
6 .SH SYNOPSIS
7 .LP
8 \fB#include <signal.h>
9 .br
10 .sp
11 \fP
12 .LP
13 \fBint pthread_sigmask(int\fP \fIhow\fP\fB, const sigset_t *restrict\fP
14 \fIset\fP\fB,
15 .br
16 \ \ \ \ \ \ sigset_t *restrict\fP \fIoset\fP\fB);
17 .br
18 \fP
19 .LP
20 \fBint sigprocmask(int\fP \fIhow\fP\fB, const sigset_t *restrict\fP
21 \fIset\fP\fB,
22 .br
23 \ \ \ \ \ \ sigset_t *restrict\fP \fIoset\fP\fB); \fP
24 \fB
25 .br
26 \fP
27 .SH DESCRIPTION
28 .LP
29 The \fIpthread_sigmask\fP() function shall examine or change (or both)
30 the calling thread's signal mask, regardless of the number
31 of threads in the process. The function shall be equivalent to \fIsigprocmask\fP(),
32 without the restriction that the call be made
33 in a single-threaded process.
34 .LP
35 In a single-threaded process, the \fIsigprocmask\fP() function shall
36 examine or change (or both) the signal mask of the calling
37 thread.
38 .LP
39 If the argument \fIset\fP is not a null pointer, it points to a set
40 of signals to be used to change the currently blocked
41 set.
42 .LP
43 The argument \fIhow\fP indicates the way in which the set is changed,
44 and the application shall ensure it consists of one of
45 the following values:
46 .TP 7
47 SIG_BLOCK
48 The resulting set shall be the union of the current set and the signal
49 set pointed to by \fIset\fP.
50 .TP 7
51 SIG_SETMASK
52 The resulting set shall be the signal set pointed to by \fIset\fP.
53 .TP 7
54 SIG_UNBLOCK
55 The resulting set shall be the intersection of the current set and
56 the complement of the signal set pointed to by
57 \fIset\fP.
58 .sp
59 .LP
60 If the argument \fIoset\fP is not a null pointer, the previous mask
61 shall be stored in the location pointed to by \fIoset\fP.
62 If \fIset\fP is a null pointer, the value of the argument \fIhow\fP
63 is not significant and the process' signal mask shall be
64 unchanged; thus the call can be used to enquire about currently blocked
65 signals.
66 .LP
67 If there are any pending unblocked signals after the call to \fIsigprocmask\fP(),
68 at least one of those signals shall be
69 delivered before the call to \fIsigprocmask\fP() returns.
70 .LP
71 It is not possible to block those signals which cannot be ignored.
72 This shall be enforced by the system without causing an error
73 to be indicated.
74 .LP
75 If any of the SIGFPE, SIGILL, SIGSEGV, or SIGBUS signals are generated
76 while they are blocked, the result is undefined, unless
77 the signal was generated by the \fIkill\fP() function, the \fIsigqueue\fP()
78 function, or the \fIraise\fP()
79 function.
80 .LP
81 If \fIsigprocmask\fP() fails, the thread's signal mask shall not be
82 changed.
83 .LP
84 The use of the \fIsigprocmask\fP() function is unspecified in a multi-threaded
85 process.
86 .SH RETURN VALUE
87 .LP
88 Upon successful completion \fIpthread_sigmask\fP() shall return 0;
89 otherwise, it shall return the corresponding error number.
90 .LP
91 Upon successful completion, \fIsigprocmask\fP() shall return 0; otherwise,
92 -1 shall be returned, \fIerrno\fP shall be set to
93 indicate the error, and the process' signal mask shall be unchanged.
94 .SH ERRORS
95 .LP
96 The \fIpthread_sigmask\fP() and \fIsigprocmask\fP() functions
97 shall fail if:
98 .TP 7
99 .B EINVAL
100 The value of the \fIhow\fP argument is not equal to one of the defined
101 values.
102 .sp
103 .LP
104 The \fIpthread_sigmask\fP() function shall not return an error code
105 of [EINTR].
106 .LP
107 \fIThe following sections are informative.\fP
108 .SH EXAMPLES
109 .LP
110 None.
111 .SH APPLICATION USAGE
112 .LP
113 None.
114 .SH RATIONALE
115 .LP
116 When a process' signal mask is changed in a signal-catching function
117 that is installed by \fIsigaction\fP(), the restoration of the signal
118 mask on return from the signal-catching
119 function overrides that change (see \fIsigaction\fP()). If the signal-catching
120 function
121 was installed with \fIsignal\fP(), it is unspecified whether this
122 occurs.
123 .LP
124 See \fIkill\fP() for a discussion of the requirement on delivery of
125 signals.
126 .SH FUTURE DIRECTIONS
127 .LP
128 None.
129 .SH SEE ALSO
130 .LP
131 \fIsigaction\fP() , \fIsigaddset\fP() , \fIsigdelset\fP() , \fIsigemptyset\fP()
132 , \fIsigfillset\fP() , \fIsigismember\fP() , \fIsigpending\fP() ,
133 \fIsigqueue\fP() , \fIsigsuspend\fP() , the Base Definitions volume
134 of IEEE\ Std\ 1003.1-2001, \fI<signal.h>\fP
135 .SH COPYRIGHT
136 Portions of this text are reprinted and reproduced in electronic form
137 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
138 -- Portable Operating System Interface (POSIX), The Open Group Base
139 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
140 Electrical and Electronics Engineers, Inc and The Open Group. In the
141 event of any discrepancy between this version and the original IEEE and
142 The Open Group Standard, the original IEEE and The Open Group Standard
143 is the referee document. The original Standard can be obtained online at
144 http://www.opengroup.org/unix/online.html .