xref: /original-bsd/lib/libc/sys/sigprocmask.2 (revision 7748387a)
1.\" Copyright (c) 1983, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"	@(#)sigprocmask.2	6.4 (Berkeley) 07/23/91
7.\"
8.Dd
9.Dt SIGPROCMASK 2
10.Os
11.Sh NAME
12.Nm sigprocmask
13.Nd manipulate current signal mask
14.Sh SYNOPSIS
15.Fd #include <signal.h>
16.Ft int
17.Fn sigprocmask "int how" "const sigset_t *set" "sigset_t *oset"
18.Fn sigmask signum
19.Sh DESCRIPTION
20The
21.Fn sigprocmask
22function examines and/or changes the current signal mask (those signals
23that are blocked from delivery).
24Signals are blocked if they are members of the current signal mask set.
25.Pp
26If
27.Fa set
28is not null, the action of
29.Fn sigprocmask
30depends on the value of the parameter
31.Fa how .
32The signal mask is changed as a function of the specified
33.Fa set
34and the current mask.
35The function is specified by
36.Fa how
37using one of the following values from
38.Aq Pa signal.h :
39.Bl -tag -width SIG_UNBLOCK
40.It Dv SIG_BLOCK
41The new mask is the union of the current mask and the specified
42.Fa set .
43.It Dv SIG_UNBLOCK
44The new mask is the intersection of the current mask
45and the complement of the specified
46.Fa set .
47.It Dv SIG_SETMASK
48The current mask is replaced by the specified
49.Fa set .
50.El
51.Pp
52If
53.Fa oset
54is not null, it is set to
55the previous value of the signal mask.
56When
57.Fa set
58is null,
59the value of
60.Ar how
61is insignificant and the mask remains unset
62providing a way to examine the signal mask without modification.
63.Pp
64The system
65quietly disallows
66.Dv SIGKILL
67or
68.Dv SIGSTOP
69to be blocked.
70.Sh RETURN VALUES
71A 0 value indicated that the call succeeded.  A -1 return value
72indicates an error occurred and
73.Va errno
74is set to indicated the reason.
75.Sh ERRORS
76The
77.Fn sigprocmask
78call will fail and the signal mask will be unchanged if one
79of the following occurs:
80.Bl -tag -width Bq Er EINVAL
81.It Bq Er EINVAL
82.Fa how
83has a value other than those listed here.
84.Sh SEE ALSO
85.Xr kill 2 ,
86.Xr sigaction 2 ,
87.Xr sigsetops 3 ,
88.Xr sigsuspend 2
89.Sh STANDARDS
90The
91.Nm sigprocmask
92function call is expected to
93conform to
94.St -p1003.1-88 .
95