]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/sigsetops.3
crypt.3: srcfix: rewrap source lines
[thirdparty/man-pages.git] / man3 / sigsetops.3
CommitLineData
fea681da
MK
1.\" Copyright (c) 1994 Mike Battersby
2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
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.
c13182ef 12.\"
fea681da
MK
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.
c13182ef 20.\"
fea681da
MK
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 23.\" %%%LICENSE_END
fea681da
MK
24.\"
25.\" Modified by aeb, 960721
c66f2b95
MK
26.\" 2005-11-21, mtk, added descriptions of sigisemptyset(), sigandset(),
27.\" and sigorset()
4c20c40c
MK
28.\" 2007-10-26 mdw added wording that a sigset_t must be initialized
29.\" prior to use
fea681da 30.\"
97986708 31.TH SIGSETOPS 3 2016-03-15 "Linux" "Linux Programmer's Manual"
fea681da
MK
32.SH NAME
33sigemptyset, sigfillset, sigaddset, sigdelset, sigismember \- POSIX
ae7656b2 34signal set operations
fea681da
MK
35.SH SYNOPSIS
36.B #include <signal.h>
6db9f2db 37.PP
fea681da 38.BI "int sigemptyset(sigset_t *" set );
6db9f2db 39.PP
fea681da 40.BI "int sigfillset(sigset_t *" set );
6db9f2db 41.PP
fea681da 42.BI "int sigaddset(sigset_t *" set ", int " signum );
6db9f2db 43.PP
fea681da 44.BI "int sigdelset(sigset_t *" set ", int " signum );
6db9f2db 45.PP
fea681da 46.BI "int sigismember(const sigset_t *" set ", int " signum );
6db9f2db 47.PP
0f200f07
MK
48.in -4n
49Feature Test Macro Requirements for glibc (see
50.BR feature_test_macros (7)):
51.in
6db9f2db 52.PP
0f200f07
MK
53.ad l
54.BR sigemptyset (),
55.BR sigfillset (),
56.BR sigaddset (),
57.BR sigdelset (),
58.BR sigismember ():
b500667c 59.RS 4
cff459de 60_POSIX_C_SOURCE
b500667c 61.RE
0f200f07 62.ad b
fea681da 63.SH DESCRIPTION
ff976006 64These functions allow the manipulation of POSIX signal sets.
fea681da 65.PP
e511ffb6 66.BR sigemptyset ()
fea681da
MK
67initializes the signal set given by
68.I set
69to empty, with all signals excluded from the set.
70.PP
e511ffb6 71.BR sigfillset ()
c13182ef 72initializes
fea681da
MK
73.I set
74to full, including all signals.
75.PP
e511ffb6 76.BR sigaddset ()
fea681da 77and
e511ffb6 78.BR sigdelset ()
fea681da
MK
79add and delete respectively signal
80.I signum
c13182ef 81from
fea681da
MK
82.IR set .
83.PP
e511ffb6 84.BR sigismember ()
fea681da
MK
85tests whether
86.I signum
c13182ef 87is a member of
a5e0a0e4 88.IR set .
4c20c40c
MK
89.PP
90Objects of type
3d5b0b76 91.I sigset_t
4c20c40c
MK
92must be initialized by a call to either
93.BR sigemptyset ()
94or
95.BR sigfillset ()
3d5b0b76 96before being passed to the functions
4c20c40c
MK
97.BR sigaddset (),
98.BR sigdelset ()
99and
100.BR sigismember ()
101or the additional glibc functions described below
102.RB ( sigisemptyset (),
103.BR sigandset (),
104and
86bd1991 105.BR sigorset ()).
4c20c40c 106The results are undefined if this is not done.
47297adb 107.SH RETURN VALUE
c13182ef 108.BR sigemptyset (),
a94dba21
MK
109.BR sigfillset (),
110.BR sigaddset (),
fea681da 111and
e511ffb6 112.BR sigdelset ()
fea681da
MK
113return 0 on success and \-1 on error.
114.PP
e511ffb6 115.BR sigismember ()
fea681da
MK
116returns 1 if
117.I signum
118is a member of
119.IR set ,
1200 if
121.I signum
122is not a member, and \-1 on error.
6db9f2db 123.PP
72cc8811
MK
124On error, these functions set
125.I errno
24453ff0 126to indicate the cause of the error.
fea681da
MK
127.SH ERRORS
128.TP
129.B EINVAL
7c5ad0df 130.I signum
fea681da 131is not a valid signal.
ec3f0bf7 132.SH ATTRIBUTES
03002fe5
PH
133For an explanation of the terms used in this section, see
134.BR attributes (7).
135.TS
136allbox;
137lbw31 lb lb
138l l l.
139Interface Attribute Value
140T{
ec3f0bf7
PH
141.BR sigemptyset (),
142.BR sigfillset (),
03002fe5 143.br
ec3f0bf7
PH
144.BR sigaddset (),
145.BR sigdelset (),
03002fe5 146.br
ec3f0bf7
PH
147.BR sigismember (),
148.BR sigisemptyset (),
03002fe5 149.br
ec3f0bf7 150.BR sigorset (),
ec3f0bf7 151.BR sigandset ()
03002fe5
PH
152T} Thread safety MT-Safe
153.TE
47297adb 154.SH CONFORMING TO
67bb2863 155POSIX.1-2001, POSIX.1-2008.
d597239c 156.SH NOTES
3f1982b2
MK
157When creating a filled signal set, the glibc
158.BR sigfillset ()
159function does not include the two real-time signals used internally
160by the NPTL threading implementation.
161See
162.BR nptl (7)
163for details.
787dd4ad 164.\"
4e701e41 165.SS Glibc extensions
c3dfd2c8
MK
166If the
167.B _GNU_SOURCE
168feature test macro is defined, then \fI<signal.h>\fP
c66f2b95 169exposes three other functions for manipulating signal
f9d8c4e6 170sets:
6db9f2db 171.PP
f9d8c4e6 172.nf
9267ec37
MK
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 );
f9d8c4e6 178.fi
6db9f2db 179.PP
f9d8c4e6 180.BR sigisemptyset ()
c66f2b95 181returns 1 if
c13182ef 182.I set
c66f2b95 183contains no signals, and 0 otherwise.
6db9f2db 184.PP
f9d8c4e6 185.BR sigorset ()
c66f2b95 186places the union of the sets
c13182ef 187.I left
c66f2b95
MK
188and
189.I right
190in
191.IR dest .
f9d8c4e6 192.BR sigandset ()
c66f2b95 193places the intersection of the sets
c13182ef 194.I left
c66f2b95
MK
195and
196.I right
197in
198.IR dest .
f9d8c4e6 199Both functions return 0 on success, and \-1 on failure.
c66f2b95 200.PP
c8f2dd47 201These functions are nonstandard (a few other systems provide similar
c66f2b95 202functions) and their use should be avoided in portable applications.
47297adb 203.SH SEE ALSO
fea681da
MK
204.BR sigaction (2),
205.BR sigpending (2),
206.BR sigprocmask (2),
207.BR sigsuspend (2)