1.\" $NetBSD: sigsetops.3,v 1.7 1997/05/16 16:03:54 kleink 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. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by the University of 17.\" California, Berkeley and its contributors. 18.\" 4. Neither the name of the University nor the names of its contributors 19.\" may be used to endorse or promote products derived from this software 20.\" without specific prior written permission. 21.\" 22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.\" @(#)sigsetops.3 8.1 (Berkeley) 6/4/93 35.\" 36.Dd June 4, 1993 37.Dt SIGSETOPS 3 38.Os 39.Sh NAME 40.Nm sigemptyset , 41.Nm sigfillset , 42.Nm sigaddset , 43.Nm sigdelset , 44.Nm sigismember 45.Nd manipulate signal sets 46.Sh SYNOPSIS 47.Fd #include <signal.h> 48.Ft int 49.Fn sigemptyset "sigset_t *set" 50.Ft int 51.Fn sigfillset "sigset_t *set" 52.Ft int 53.Fn sigaddset "sigset_t *set" "int signo" 54.Ft int 55.Fn sigdelset "sigset_t *set" "int signo" 56.Ft int 57.Fn sigismember "sigset_t *set" "int signo" 58.Sh DESCRIPTION 59These functions manipulate signal sets stored in a 60.Fa sigset_t . 61Either 62.Fn sigemptyset 63or 64.Fn sigfillset 65must be called for every object of type 66.Fa sigset_t 67before any other use of the object. 68.Fn sigemptyset 69and 70.Fn sigfillset 71are provided as macros, but actual functions are available 72if their names are undefined (with #undef 73.Em name ) . 74.Pp 75The 76.Fn sigemptyset 77function initializes a signal set to be empty. 78.Pp 79The 80.Fn sigfillset 81function initializes a signal set to contain all signals. 82.Pp 83The 84.Fn sigaddset 85function adds the specified signal 86.Fa signo 87to the signal set. 88.Pp 89The 90.Fn sigdelset 91function deletes the specified signal 92.Fa signo 93from the signal set. 94.Pp 95The 96.Fn sigismember 97function returns whether a specified signal 98.Fa signo 99is contained in the signal set. 100.Pp 101These functions 102are provided as macros in the include file <signal.h>. 103Actual functions are available 104if their names are undefined (with #undef 105.Em name ) . 106.Sh RETURN VALUES 107The 108.Fn sigismember 109function returns 1 110if the signal is a member of the set, 111a 0 otherwise. 112The other functions return 0 upon success. 113A \-1 return value 114indicates an error occurred and the global variable 115.Va errno 116is set to indicated the reason. 117.Sh ERRORS 118These functions could fail if one of the following occurs: 119.Bl -tag -width Er 120.It Bq Er EINVAL 121.Fa signo 122has an invalid value. 123.El 124.Sh SEE ALSO 125.Xr kill 2 , 126.Xr sigaction 2 , 127.Xr sigsuspend 2 128.Sh STANDARDS 129These functions conform to 130.St -p1003.1-90 . 131