]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/sigsetops.3
accept.2, execve.2, futimesat.2, getresuid.2, getrlimit.2, madvise.2, mq_getsetattr...
[thirdparty/man-pages.git] / man3 / sigsetops.3
1 .\" Copyright (c) 1994 Mike Battersby
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Modified by aeb, 960721
24 .\" 2005-11-21, mtk, added descriptions of sigisemptyset(), sigandset(),
25 .\" and sigorset()
26 .\" 2007-10-26 mdw added wording that a sigset_t must be initialized
27 .\" prior to use
28 .\"
29 .TH SIGSETOPS 3 2008-09-01 "Linux" "Linux Programmer's Manual"
30 .SH NAME
31 sigemptyset, sigfillset, sigaddset, sigdelset, sigismember \- POSIX
32 signal set operations.
33 .SH SYNOPSIS
34 .B #include <signal.h>
35 .sp
36 .BI "int sigemptyset(sigset_t *" set );
37 .sp
38 .BI "int sigfillset(sigset_t *" set );
39 .sp
40 .BI "int sigaddset(sigset_t *" set ", int " signum );
41 .sp
42 .BI "int sigdelset(sigset_t *" set ", int " signum );
43 .sp
44 .BI "int sigismember(const sigset_t *" set ", int " signum );
45 .sp
46 .in -4n
47 Feature Test Macro Requirements for glibc (see
48 .BR feature_test_macros (7)):
49 .in
50 .sp
51 .ad l
52 .BR sigemptyset (),
53 .BR sigfillset (),
54 .BR sigaddset (),
55 .BR sigdelset (),
56 .BR sigismember ():
57 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE
58 .ad b
59 .SH DESCRIPTION
60 These functions allow the manipulation of POSIX signal sets.
61 .PP
62 .BR sigemptyset ()
63 initializes the signal set given by
64 .I set
65 to empty, with all signals excluded from the set.
66 .PP
67 .BR sigfillset ()
68 initializes
69 .I set
70 to full, including all signals.
71 .PP
72 .BR sigaddset ()
73 and
74 .BR sigdelset ()
75 add and delete respectively signal
76 .I signum
77 from
78 .IR set .
79 .PP
80 .BR sigismember ()
81 tests whether
82 .I signum
83 is a member of
84 .IR set .
85 .PP
86 Objects of type
87 .I sigset_t
88 must be initialized by a call to either
89 .BR sigemptyset ()
90 or
91 .BR sigfillset ()
92 before being passed to the functions
93 .BR sigaddset (),
94 .BR sigdelset ()
95 and
96 .BR sigismember ()
97 or the additional glibc functions described below
98 .RB ( sigisemptyset (),
99 .BR sigandset (),
100 and
101 .BR sigorset ()).
102 The results are undefined if this is not done.
103 .SH "RETURN VALUE"
104 .BR sigemptyset (),
105 .BR sigfillset (),
106 .BR sigaddset (),
107 and
108 .BR sigdelset ()
109 return 0 on success and \-1 on error.
110 .PP
111 .BR sigismember ()
112 returns 1 if
113 .I signum
114 is a member of
115 .IR set ,
116 0 if
117 .I signum
118 is not a member, and \-1 on error.
119 .SH ERRORS
120 .TP
121 .B EINVAL
122 .I sig
123 is not a valid signal.
124 .SH "CONFORMING TO"
125 POSIX.1-2001.
126 .SH NOTES
127 .SS Glibc Notes
128 If the
129 .B _GNU_SOURCE
130 feature test macro is defined, then \fI<signal.h>\fP
131 exposes three other functions for manipulating signal
132 sets.
133 .TP
134 .BI "int sigisemptyset(sigset_t *" set );
135 returns 1 if
136 .I set
137 contains no signals, and 0 otherwise.
138 .TP
139 .BI "int sigorset(sigset_t *" dest ", sigset_t *" left \
140 ", sigset_t *" right );
141 places the union of the sets
142 .I left
143 and
144 .I right
145 in
146 .IR dest .
147 .TP
148 .BI "int sigandset(sigset_t *" dest ", sigset_t *" left \
149 ", sigset_t *" right );
150 places the intersection of the sets
151 .I left
152 and
153 .I right
154 in
155 .IR dest .
156 .PP
157 .BR sigorset ()
158 and
159 .BR sigandset ()
160 return 0 on success, and \-1 on failure.
161 .PP
162 These functions are nonstandard (a few other systems provide similar
163 functions) and their use should be avoided in portable applications.
164 .SH "SEE ALSO"
165 .BR sigaction (2),
166 .BR sigpending (2),
167 .BR sigprocmask (2),
168 .BR sigsuspend (2)