]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) 1994 Mike Battersby |
2 | .\" | |
5fbde956 | 3 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da MK |
4 | .\" |
5 | .\" Modified by aeb, 960721 | |
c66f2b95 MK |
6 | .\" 2005-11-21, mtk, added descriptions of sigisemptyset(), sigandset(), |
7 | .\" and sigorset() | |
4c20c40c MK |
8 | .\" 2007-10-26 mdw added wording that a sigset_t must be initialized |
9 | .\" prior to use | |
fea681da | 10 | .\" |
45186a5d | 11 | .TH SIGSETOPS 3 2021-03-22 "Linux man-pages (unreleased)" |
fea681da MK |
12 | .SH NAME |
13 | sigemptyset, sigfillset, sigaddset, sigdelset, sigismember \- POSIX | |
ae7656b2 | 14 | signal set operations |
5434476b AC |
15 | .SH LIBRARY |
16 | Standard C library | |
8fc3b2cf | 17 | .RI ( libc ", " \-lc ) |
fea681da | 18 | .SH SYNOPSIS |
15d65653 | 19 | .nf |
fea681da | 20 | .B #include <signal.h> |
6db9f2db | 21 | .PP |
fea681da | 22 | .BI "int sigemptyset(sigset_t *" set ); |
fea681da | 23 | .BI "int sigfillset(sigset_t *" set ); |
6db9f2db | 24 | .PP |
fea681da | 25 | .BI "int sigaddset(sigset_t *" set ", int " signum ); |
fea681da | 26 | .BI "int sigdelset(sigset_t *" set ", int " signum ); |
6db9f2db | 27 | .PP |
fea681da | 28 | .BI "int sigismember(const sigset_t *" set ", int " signum ); |
15d65653 | 29 | .fi |
6db9f2db | 30 | .PP |
d39ad78f | 31 | .RS -4 |
0f200f07 MK |
32 | Feature Test Macro Requirements for glibc (see |
33 | .BR feature_test_macros (7)): | |
d39ad78f | 34 | .RE |
6db9f2db | 35 | .PP |
0f200f07 MK |
36 | .BR sigemptyset (), |
37 | .BR sigfillset (), | |
38 | .BR sigaddset (), | |
39 | .BR sigdelset (), | |
40 | .BR sigismember (): | |
9d2adbae MK |
41 | .nf |
42 | _POSIX_C_SOURCE | |
43 | .fi | |
fea681da | 44 | .SH DESCRIPTION |
ff976006 | 45 | These functions allow the manipulation of POSIX signal sets. |
fea681da | 46 | .PP |
e511ffb6 | 47 | .BR sigemptyset () |
fea681da MK |
48 | initializes the signal set given by |
49 | .I set | |
50 | to empty, with all signals excluded from the set. | |
51 | .PP | |
e511ffb6 | 52 | .BR sigfillset () |
c13182ef | 53 | initializes |
fea681da MK |
54 | .I set |
55 | to full, including all signals. | |
56 | .PP | |
e511ffb6 | 57 | .BR sigaddset () |
fea681da | 58 | and |
e511ffb6 | 59 | .BR sigdelset () |
fea681da MK |
60 | add and delete respectively signal |
61 | .I signum | |
c13182ef | 62 | from |
fea681da MK |
63 | .IR set . |
64 | .PP | |
e511ffb6 | 65 | .BR sigismember () |
fea681da MK |
66 | tests whether |
67 | .I signum | |
c13182ef | 68 | is a member of |
a5e0a0e4 | 69 | .IR set . |
4c20c40c MK |
70 | .PP |
71 | Objects of type | |
3d5b0b76 | 72 | .I sigset_t |
4c20c40c MK |
73 | must be initialized by a call to either |
74 | .BR sigemptyset () | |
75 | or | |
76 | .BR sigfillset () | |
3d5b0b76 | 77 | before being passed to the functions |
4c20c40c | 78 | .BR sigaddset (), |
d556548b | 79 | .BR sigdelset (), |
4c20c40c MK |
80 | and |
81 | .BR sigismember () | |
82 | or the additional glibc functions described below | |
83 | .RB ( sigisemptyset (), | |
84 | .BR sigandset (), | |
85 | and | |
86bd1991 | 86 | .BR sigorset ()). |
4c20c40c | 87 | The results are undefined if this is not done. |
47297adb | 88 | .SH RETURN VALUE |
c13182ef | 89 | .BR sigemptyset (), |
a94dba21 MK |
90 | .BR sigfillset (), |
91 | .BR sigaddset (), | |
fea681da | 92 | and |
e511ffb6 | 93 | .BR sigdelset () |
fea681da MK |
94 | return 0 on success and \-1 on error. |
95 | .PP | |
e511ffb6 | 96 | .BR sigismember () |
fea681da MK |
97 | returns 1 if |
98 | .I signum | |
99 | is a member of | |
100 | .IR set , | |
101 | 0 if | |
102 | .I signum | |
103 | is not a member, and \-1 on error. | |
6db9f2db | 104 | .PP |
72cc8811 MK |
105 | On error, these functions set |
106 | .I errno | |
855d489a | 107 | to indicate the error. |
fea681da MK |
108 | .SH ERRORS |
109 | .TP | |
110 | .B EINVAL | |
7c5ad0df | 111 | .I signum |
fea681da | 112 | is not a valid signal. |
ec3f0bf7 | 113 | .SH ATTRIBUTES |
03002fe5 PH |
114 | For an explanation of the terms used in this section, see |
115 | .BR attributes (7). | |
c466875e MK |
116 | .ad l |
117 | .nh | |
03002fe5 PH |
118 | .TS |
119 | allbox; | |
c466875e | 120 | lbx lb lb |
03002fe5 PH |
121 | l l l. |
122 | Interface Attribute Value | |
123 | T{ | |
ec3f0bf7 PH |
124 | .BR sigemptyset (), |
125 | .BR sigfillset (), | |
126 | .BR sigaddset (), | |
127 | .BR sigdelset (), | |
128 | .BR sigismember (), | |
129 | .BR sigisemptyset (), | |
130 | .BR sigorset (), | |
ec3f0bf7 | 131 | .BR sigandset () |
03002fe5 PH |
132 | T} Thread safety MT-Safe |
133 | .TE | |
c466875e MK |
134 | .hy |
135 | .ad | |
136 | .sp 1 | |
3113c7f3 | 137 | .SH STANDARDS |
67bb2863 | 138 | POSIX.1-2001, POSIX.1-2008. |
d597239c | 139 | .SH NOTES |
3f1982b2 MK |
140 | When creating a filled signal set, the glibc |
141 | .BR sigfillset () | |
142 | function does not include the two real-time signals used internally | |
143 | by the NPTL threading implementation. | |
144 | See | |
145 | .BR nptl (7) | |
146 | for details. | |
787dd4ad | 147 | .\" |
4e701e41 | 148 | .SS Glibc extensions |
c3dfd2c8 MK |
149 | If the |
150 | .B _GNU_SOURCE | |
151 | feature test macro is defined, then \fI<signal.h>\fP | |
c66f2b95 | 152 | exposes three other functions for manipulating signal |
f9d8c4e6 | 153 | sets: |
6db9f2db | 154 | .PP |
f9d8c4e6 | 155 | .nf |
9267ec37 MK |
156 | .BI "int sigisemptyset(const sigset_t *" set ); |
157 | .BI "int sigorset(sigset_t *" dest ", const sigset_t *" left , | |
158 | .BI " const sigset_t *" right ); | |
159 | .BI "int sigandset(sigset_t *" dest ", const sigset_t *" left , | |
160 | .BI " const sigset_t *" right ); | |
f9d8c4e6 | 161 | .fi |
6db9f2db | 162 | .PP |
f9d8c4e6 | 163 | .BR sigisemptyset () |
c66f2b95 | 164 | returns 1 if |
c13182ef | 165 | .I set |
c66f2b95 | 166 | contains no signals, and 0 otherwise. |
6db9f2db | 167 | .PP |
f9d8c4e6 | 168 | .BR sigorset () |
c66f2b95 | 169 | places the union of the sets |
c13182ef | 170 | .I left |
c66f2b95 MK |
171 | and |
172 | .I right | |
173 | in | |
174 | .IR dest . | |
f9d8c4e6 | 175 | .BR sigandset () |
c66f2b95 | 176 | places the intersection of the sets |
c13182ef | 177 | .I left |
c66f2b95 MK |
178 | and |
179 | .I right | |
180 | in | |
181 | .IR dest . | |
f9d8c4e6 | 182 | Both functions return 0 on success, and \-1 on failure. |
c66f2b95 | 183 | .PP |
c8f2dd47 | 184 | These functions are nonstandard (a few other systems provide similar |
c66f2b95 | 185 | functions) and their use should be avoided in portable applications. |
47297adb | 186 | .SH SEE ALSO |
fea681da MK |
187 | .BR sigaction (2), |
188 | .BR sigpending (2), | |
189 | .BR sigprocmask (2), | |
190 | .BR sigsuspend (2) |