Debian Codegraph @

upstream/debian-trixie/man3/sigsetops.3

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