date and time created 91/04/12 13:40:31 by bostic
[unix-history] / usr / src / lib / libc / sys / sigprocmask.2
CommitLineData
931b8415 1.\" Copyright (c) 1983, 1991 The Regents of the University of California.
87714767
MK
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
931b8415 6.\" @(#)sigprocmask.2 6.3 (Berkeley) %G%
87714767 7.\"
931b8415
CL
8.Dd
9.Dt SIGPROCMASK 2
10.Os BSD 4.4
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
87714767 20The
931b8415
CL
21.Fn sigprocmask
22function examines and/or changes the current signal mask (those signals
87714767
MK
23that are blocked from delivery).
24Signals are blocked if they are members of the current signal mask set.
931b8415 25.Pp
87714767 26If
931b8415 27.Fa set
87714767 28is not null, the action of
931b8415 29.Fn sigprocmask
87714767 30depends on the value of the parameter
931b8415 31.Fa how .
87714767 32The signal mask is changed as a function of the specified
931b8415 33.Fa set
87714767
MK
34and the current mask.
35The function is specified by
931b8415
CL
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
87714767 41The new mask is the union of the current mask and the specified
931b8415
CL
42.Fa set .
43.It Dv SIG_UNBLOCK
87714767
MK
44The new mask is the intersection of the current mask
45and the complement of the specified
931b8415
CL
46.Fa set .
47.It Dv SIG_SETMASK
87714767 48The current mask is replaced by the specified
931b8415
CL
49.Fa set .
50.El
51.Pp
87714767 52If
931b8415
CL
53.Fa oset
54is not null, it is set to
87714767
MK
55the previous value of the signal mask.
56When
931b8415
CL
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
87714767 64The system
931b8415
CL
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
87714767 72indicates an error occurred and
931b8415 73.Va errno
87714767 74is set to indicated the reason.
931b8415 75.Sh ERRORS
87714767 76The
931b8415 77.Fn sigprocmask
87714767
MK
78call will fail and the signal mask will be unchanged if one
79of the following occurs:
931b8415
CL
80.Bl -tag -width Bq Er EINVAL
81.It Bq Er EINVAL
82.Fa how
87714767 83has a value other than those listed here.
931b8415
CL
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.Fn sigprocmask
92function call is expected to
93conform to IEEE Std 1003.1-1988
94.Pq Dq Tn POSIX .