xref: /netbsd-src/lib/libc/gen/sigset.3 (revision 23c8222edbfb0f0932d88a8351d3a0cf817dfb9e)
1.\"	$NetBSD: sigset.3,v 1.3 2003/04/16 13:34:39 wiz Exp $
2.\"
3.\" Copyright (c) 2003 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Klaus Klein.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\" 3. All advertising materials mentioning features or use of this software
18.\"    must display the following acknowledgement:
19.\"        This product includes software developed by the NetBSD
20.\"        Foundation, Inc. and its contributors.
21.\" 4. Neither the name of The NetBSD Foundation nor the names of its
22.\"    contributors may be used to endorse or promote products derived
23.\"    from this software without specific prior written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35.\" POSSIBILITY OF SUCH DAMAGE.
36.\"
37.Dd January 16, 2003
38.Dt SIGSET 3
39.Os
40.Sh NAME
41.Nm sigset
42.Nd manipulate signal dispositions
43.Sh LIBRARY
44.Lb libc
45.Sh SYNOPSIS
46.In signal.h
47.\" The following is Quite Ugly, but syntactically correct.  Don't try to
48.\" fix it.
49.Ft void \*(lp*
50.Fn sigset "int sig" "void \*(lp*disp\*(rp\*(lpint\*(rp\*(rp\*(rp\*(lpint"
51.Sh DESCRIPTION
52.Bf -symbolic
53This interface is made obsolete by
54.Xr sigaction 2
55and
56.Xr sigprocmask 2 .
57.Ef
58.Pp
59The
60.Fn sigset
61function manipulates the disposition of the signal
62.Fa sig .
63The new disposition is given in
64.Fa disp .
65.Pp
66If
67.Fa disp
68is one of
69.Dv SIG_DFL ,
70.Dv SIG_IGN ,
71or the address of a handler function,
72the disposition of
73.Fa sig
74is changed accordingly, and
75.Fa sig
76is removed from the process' signal mask.
77Also, if
78.Fa disp
79is the address of a handler function,
80.Fa sig
81will be added to the process' signal mask during execution of the handler.
82.Pp
83If
84.Fa disp
85is equal to
86.Dv SIG_HOLD ,
87.Fa sig
88is added to the calling process' signal mask and the disposition of
89.Fa sig
90remains unchanged.
91.Sh RETURN VALUES
92If successful, the
93.Fn sigset
94function returns
95.Dv SIG_HOLD
96if
97.Fa sig
98had been blocked,
99and the previous disposition of
100.Fa sig
101if it had not been blocked.
102Otherwise
103.Dv SIG_ERR
104is returned and
105.Va errno
106is set to indicate the error.
107.Sh ERRORS
108The
109.Fn sigignore
110function will fail if:
111.Bl -tag -width Er
112.It Bq Er EINVAL
113The argument
114.Fa sig
115is not a valid signal number.
116.It Bq Er EINVAL
117An attempt is made to ignore a signal that cannot be ignored,
118such as
119.Dv SIGKILL
120or
121.Dv SIGSTOP .
122.El
123.Sh SEE ALSO
124.Xr sigaction 2 ,
125.Xr sigprocmask 2
126.Sh STANDARDS
127The
128.Fn sigignore
129function conforms to
130.St -p1003.1-2001 .
131