mount_setattr.2: Further tweaks after feedback from Christian Brauner
[man-pages.git] / man3 / sigsetops.3
blob98463ab3a13a3a11fb3b86178c5ccaa79989cc65
1 .\" Copyright (c) 1994 Mike Battersby
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Modified by aeb, 960721
26 .\" 2005-11-21, mtk, added descriptions of sigisemptyset(), sigandset(),
27 .\"                  and sigorset()
28 .\" 2007-10-26 mdw   added wording that a sigset_t must be initialized
29 .\"                  prior to use
30 .\"
31 .TH SIGSETOPS 3 2021-03-22 "Linux" "Linux Programmer's Manual"
32 .SH NAME
33 sigemptyset, sigfillset, sigaddset, sigdelset, sigismember \- POSIX
34 signal set operations
35 .SH SYNOPSIS
36 .nf
37 .B #include <signal.h>
38 .PP
39 .BI "int sigemptyset(sigset_t *" set );
40 .BI "int sigfillset(sigset_t *" set );
41 .PP
42 .BI "int sigaddset(sigset_t *" set ", int " signum );
43 .BI "int sigdelset(sigset_t *" set ", int " signum );
44 .PP
45 .BI "int sigismember(const sigset_t *" set ", int " signum );
46 .fi
47 .PP
48 .RS -4
49 Feature Test Macro Requirements for glibc (see
50 .BR feature_test_macros (7)):
51 .RE
52 .PP
53 .BR sigemptyset (),
54 .BR sigfillset (),
55 .BR sigaddset (),
56 .BR sigdelset (),
57 .BR sigismember ():
58 .nf
59     _POSIX_C_SOURCE
60 .fi
61 .SH DESCRIPTION
62 These functions allow the manipulation of POSIX signal sets.
63 .PP
64 .BR sigemptyset ()
65 initializes the signal set given by
66 .I set
67 to empty, with all signals excluded from the set.
68 .PP
69 .BR sigfillset ()
70 initializes
71 .I set
72 to full, including all signals.
73 .PP
74 .BR sigaddset ()
75 and
76 .BR sigdelset ()
77 add and delete respectively signal
78 .I signum
79 from
80 .IR set .
81 .PP
82 .BR sigismember ()
83 tests whether
84 .I signum
85 is a member of
86 .IR set .
87 .PP
88 Objects of type
89 .I sigset_t
90 must be initialized by a call to either
91 .BR sigemptyset ()
93 .BR sigfillset ()
94 before being passed to the functions
95 .BR sigaddset (),
96 .BR sigdelset (),
97 and
98 .BR sigismember ()
99 or the additional glibc functions described below
100 .RB ( sigisemptyset (),
101 .BR sigandset (),
103 .BR sigorset ()).
104 The results are undefined if this is not done.
105 .SH RETURN VALUE
106 .BR sigemptyset (),
107 .BR sigfillset (),
108 .BR sigaddset (),
110 .BR sigdelset ()
111 return 0 on success and \-1 on error.
113 .BR sigismember ()
114 returns 1 if
115 .I signum
116 is a member of
117 .IR set ,
118 0 if
119 .I signum
120 is not a member, and \-1 on error.
122 On error, these functions set
123 .I errno
124 to indicate the error.
125 .SH ERRORS
127 .B EINVAL
128 .I signum
129 is not a valid signal.
130 .SH ATTRIBUTES
131 For an explanation of the terms used in this section, see
132 .BR attributes (7).
133 .ad l
136 allbox;
137 lbx lb lb
138 l l l.
139 Interface       Attribute       Value
141 .BR sigemptyset (),
142 .BR sigfillset (),
143 .BR sigaddset (),
144 .BR sigdelset (),
145 .BR sigismember (),
146 .BR sigisemptyset (),
147 .BR sigorset (),
148 .BR sigandset ()
149 T}      Thread safety   MT-Safe
153 .sp 1
154 .SH CONFORMING TO
155 POSIX.1-2001, POSIX.1-2008.
156 .SH NOTES
157 When creating a filled signal set, the glibc
158 .BR sigfillset ()
159 function does not include the two real-time signals used internally
160 by the NPTL threading implementation.
162 .BR nptl (7)
163 for details.
165 .SS Glibc extensions
166 If the
167 .B _GNU_SOURCE
168 feature test macro is defined, then \fI<signal.h>\fP
169 exposes three other functions for manipulating signal
170 sets:
173 .BI "int sigisemptyset(const sigset_t *" set );
174 .BI "int sigorset(sigset_t *" dest ", const sigset_t *" left ,
175 .BI "              const sigset_t *" right );
176 .BI "int sigandset(sigset_t *" dest ", const sigset_t *" left ,
177 .BI "              const sigset_t *" right );
180 .BR sigisemptyset ()
181 returns 1 if
182 .I set
183 contains no signals, and 0 otherwise.
185 .BR sigorset ()
186 places the union of the sets
187 .I left
189 .I right
191 .IR dest .
192 .BR sigandset ()
193 places the intersection of the sets
194 .I left
196 .I right
198 .IR dest .
199 Both functions return 0 on success, and \-1 on failure.
201 These functions are nonstandard (a few other systems provide similar
202 functions) and their use should be avoided in portable applications.
203 .SH SEE ALSO
204 .BR sigaction (2),
205 .BR sigpending (2),
206 .BR sigprocmask (2),
207 .BR sigsuspend (2)