1.\"	$OpenBSD: sigaddset.3,v 1.1 2017/05/29 09:40:02 deraadt Exp $
2.\"
3.\" Copyright (c) 1983, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.Dd $Mdocdate: May 29 2017 $
31.Dt SIGADDSET 3
32.Os
33.Sh NAME
34.Nm sigemptyset ,
35.Nm sigfillset ,
36.Nm sigaddset ,
37.Nm sigdelset ,
38.Nm sigismember
39.Nd manipulate signal sets
40.Sh SYNOPSIS
41.In signal.h
42.Ft int
43.Fn sigemptyset "sigset_t *set"
44.Ft int
45.Fn sigfillset "sigset_t *set"
46.Ft int
47.Fn sigaddset "sigset_t *set" "int signo"
48.Ft int
49.Fn sigdelset "sigset_t *set" "int signo"
50.Ft int
51.Fn sigismember "const sigset_t *set" "int signo"
52.Sh DESCRIPTION
53These functions manipulate signal sets stored in a
54.Fa sigset_t .
55Either
56.Fn sigemptyset
57or
58.Fn sigfillset
59must be called for every object of type
60.Fa sigset_t
61before any other use of the object.
62.Fn sigemptyset
63and
64.Fn sigfillset
65are provided as macros, but actual functions are available
66if their names are undefined (with #undef
67.Ar name ) .
68.Pp
69The
70.Fn sigemptyset
71function initializes a signal set to be empty.
72.Pp
73.Fn sigfillset
74initializes a signal set to contain all signals.
75.Pp
76.Fn sigaddset
77adds the specified signal
78.Fa signo
79to the signal set.
80.Pp
81.Fn sigdelset
82deletes the specified signal
83.Fa signo
84from the signal set.
85.Pp
86.Fn sigismember
87returns whether a specified signal
88.Fa signo
89is contained in the signal set.
90.Sh RETURN VALUES
91The
92.Fn sigismember
93function returns 1
94if the signal is a member of the set and 0 otherwise.
95The other functions return 0 upon success.
96A \-1 return value
97indicates an error occurred and the global variable
98.Va errno
99is set to indicate the reason.
100.Sh ERRORS
101These functions may fail if one of the following occurs:
102.Bl -tag -width Er
103.It Bq Er EINVAL
104The specified signal
105.Fa signo
106is not a valid signal number.
107.El
108.Sh SEE ALSO
109.Xr kill 2 ,
110.Xr sigaction 2 ,
111.Xr sigpending 2 ,
112.Xr sigprocmask 2 ,
113.Xr sigsuspend 2
114.Sh STANDARDS
115These functions are defined by
116.St -p1003.1-90 .
117