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