Commit | Line | Data |
---|---|---|
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 | 20 | The |
931b8415 CL |
21 | .Fn sigprocmask |
22 | function examines and/or changes the current signal mask (those signals | |
87714767 MK |
23 | that are blocked from delivery). |
24 | Signals are blocked if they are members of the current signal mask set. | |
931b8415 | 25 | .Pp |
87714767 | 26 | If |
931b8415 | 27 | .Fa set |
87714767 | 28 | is not null, the action of |
931b8415 | 29 | .Fn sigprocmask |
87714767 | 30 | depends on the value of the parameter |
931b8415 | 31 | .Fa how . |
87714767 | 32 | The signal mask is changed as a function of the specified |
931b8415 | 33 | .Fa set |
87714767 MK |
34 | and the current mask. |
35 | The function is specified by | |
931b8415 CL |
36 | .Fa how |
37 | using one of the following values from | |
38 | .Aq Pa signal.h : | |
39 | .Bl -tag -width SIG_UNBLOCK | |
40 | .It Dv SIG_BLOCK | |
87714767 | 41 | The new mask is the union of the current mask and the specified |
931b8415 CL |
42 | .Fa set . |
43 | .It Dv SIG_UNBLOCK | |
87714767 MK |
44 | The new mask is the intersection of the current mask |
45 | and the complement of the specified | |
931b8415 CL |
46 | .Fa set . |
47 | .It Dv SIG_SETMASK | |
87714767 | 48 | The current mask is replaced by the specified |
931b8415 CL |
49 | .Fa set . |
50 | .El | |
51 | .Pp | |
87714767 | 52 | If |
931b8415 CL |
53 | .Fa oset |
54 | is not null, it is set to | |
87714767 MK |
55 | the previous value of the signal mask. |
56 | When | |
931b8415 CL |
57 | .Fa set |
58 | is null, | |
59 | the value of | |
60 | .Ar how | |
61 | is insignificant and the mask remains unset | |
62 | providing a way to examine the signal mask without modification. | |
63 | .Pp | |
87714767 | 64 | The system |
931b8415 CL |
65 | quietly disallows |
66 | .Dv SIGKILL | |
67 | or | |
68 | .Dv SIGSTOP | |
69 | to be blocked. | |
70 | .Sh RETURN VALUES | |
71 | A 0 value indicated that the call succeeded. A -1 return value | |
87714767 | 72 | indicates an error occurred and |
931b8415 | 73 | .Va errno |
87714767 | 74 | is set to indicated the reason. |
931b8415 | 75 | .Sh ERRORS |
87714767 | 76 | The |
931b8415 | 77 | .Fn sigprocmask |
87714767 MK |
78 | call will fail and the signal mask will be unchanged if one |
79 | of the following occurs: | |
931b8415 CL |
80 | .Bl -tag -width Bq Er EINVAL |
81 | .It Bq Er EINVAL | |
82 | .Fa how | |
87714767 | 83 | has 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 | |
90 | The | |
91 | .Fn sigprocmask | |
92 | function call is expected to | |
93 | conform to IEEE Std 1003.1-1988 | |
94 | .Pq Dq Tn POSIX . |