]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/sigsetops.3
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man3 / sigsetops.3
CommitLineData
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
13sigemptyset, sigfillset, sigaddset, sigdelset, sigismember \- POSIX
ae7656b2 14signal set operations
5434476b
AC
15.SH LIBRARY
16Standard 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
32Feature 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 45These functions allow the manipulation of POSIX signal sets.
fea681da 46.PP
e511ffb6 47.BR sigemptyset ()
fea681da
MK
48initializes the signal set given by
49.I set
50to empty, with all signals excluded from the set.
51.PP
e511ffb6 52.BR sigfillset ()
c13182ef 53initializes
fea681da
MK
54.I set
55to full, including all signals.
56.PP
e511ffb6 57.BR sigaddset ()
fea681da 58and
e511ffb6 59.BR sigdelset ()
fea681da
MK
60add and delete respectively signal
61.I signum
c13182ef 62from
fea681da
MK
63.IR set .
64.PP
e511ffb6 65.BR sigismember ()
fea681da
MK
66tests whether
67.I signum
c13182ef 68is a member of
a5e0a0e4 69.IR set .
4c20c40c
MK
70.PP
71Objects of type
3d5b0b76 72.I sigset_t
4c20c40c
MK
73must be initialized by a call to either
74.BR sigemptyset ()
75or
76.BR sigfillset ()
3d5b0b76 77before being passed to the functions
4c20c40c 78.BR sigaddset (),
d556548b 79.BR sigdelset (),
4c20c40c
MK
80and
81.BR sigismember ()
82or the additional glibc functions described below
83.RB ( sigisemptyset (),
84.BR sigandset (),
85and
86bd1991 86.BR sigorset ()).
4c20c40c 87The 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 92and
e511ffb6 93.BR sigdelset ()
fea681da
MK
94return 0 on success and \-1 on error.
95.PP
e511ffb6 96.BR sigismember ()
fea681da
MK
97returns 1 if
98.I signum
99is a member of
100.IR set ,
1010 if
102.I signum
103is not a member, and \-1 on error.
6db9f2db 104.PP
72cc8811
MK
105On error, these functions set
106.I errno
855d489a 107to indicate the error.
fea681da
MK
108.SH ERRORS
109.TP
110.B EINVAL
7c5ad0df 111.I signum
fea681da 112is not a valid signal.
ec3f0bf7 113.SH ATTRIBUTES
03002fe5
PH
114For 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
119allbox;
c466875e 120lbx lb lb
03002fe5
PH
121l l l.
122Interface Attribute Value
123T{
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
132T} Thread safety MT-Safe
133.TE
c466875e
MK
134.hy
135.ad
136.sp 1
3113c7f3 137.SH STANDARDS
67bb2863 138POSIX.1-2001, POSIX.1-2008.
d597239c 139.SH NOTES
3f1982b2
MK
140When creating a filled signal set, the glibc
141.BR sigfillset ()
142function does not include the two real-time signals used internally
143by the NPTL threading implementation.
144See
145.BR nptl (7)
146for details.
787dd4ad 147.\"
4e701e41 148.SS Glibc extensions
c3dfd2c8
MK
149If the
150.B _GNU_SOURCE
151feature test macro is defined, then \fI<signal.h>\fP
c66f2b95 152exposes three other functions for manipulating signal
f9d8c4e6 153sets:
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 164returns 1 if
c13182ef 165.I set
c66f2b95 166contains no signals, and 0 otherwise.
6db9f2db 167.PP
f9d8c4e6 168.BR sigorset ()
c66f2b95 169places the union of the sets
c13182ef 170.I left
c66f2b95
MK
171and
172.I right
173in
174.IR dest .
f9d8c4e6 175.BR sigandset ()
c66f2b95 176places the intersection of the sets
c13182ef 177.I left
c66f2b95
MK
178and
179.I right
180in
181.IR dest .
f9d8c4e6 182Both functions return 0 on success, and \-1 on failure.
c66f2b95 183.PP
c8f2dd47 184These functions are nonstandard (a few other systems provide similar
c66f2b95 185functions) 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)