Commit | Line | Data |
---|---|---|
15715acc KB |
1 | .\" Copyright (c) 1983, 1991, 1993 |
2 | .\" The Regents of the University of California. All rights reserved. | |
87714767 | 3 | .\" |
faf7e3e0 | 4 | .\" %sccs.include.redist.roff% |
87714767 | 5 | .\" |
15715acc | 6 | .\" @(#)sigsuspend.2 8.1 (Berkeley) %G% |
87714767 | 7 | .\" |
931b8415 CL |
8 | .Dd |
9 | .Dt SIGSUSPEND 2 | |
faf7e3e0 | 10 | .Os |
931b8415 CL |
11 | .Sh NAME |
12 | .Nm sigsuspend | |
13 | .Nd atomically release blocked signals and wait for interrupt | |
14 | .Sh SYNOPSIS | |
4add9a99 | 15 | .Fd #include <signal.h> |
931b8415 CL |
16 | .Ft int |
17 | .Fn sigsuspend "const sigset_t *sigmask" | |
18 | .Sh DESCRIPTION | |
19 | .Fn Sigsuspend | |
87714767 | 20 | temporarily changes the blocked signal mask to the set to which |
931b8415 | 21 | .Fa sigmask |
87714767 MK |
22 | points, |
23 | and then waits for a signal to arrive; | |
24 | on return the previous set of masked signals is restored. | |
25 | The signal mask set | |
26 | is usually empty to indicate that all | |
27 | signals are to be unblocked for the duration of the call. | |
931b8415 | 28 | .Pp |
87714767 | 29 | In normal usage, a signal is blocked using |
931b8415 | 30 | .Xr sigprocmask 2 |
87714767 MK |
31 | to begin a critical section, variables modified on the occurrence |
32 | of the signal are examined to determine that there is no work | |
33 | to be done, and the process pauses awaiting work by using | |
931b8415 | 34 | .Fn sigsuspend |
87714767 | 35 | with the previous mask returned by |
931b8415 CL |
36 | .Xr sigprocmask . |
37 | .Sh RETURN VALUES | |
38 | The | |
39 | .Fn sigsuspend | |
40 | function | |
41 | always terminates by being interrupted, returning -1 with | |
42 | .Va errno | |
43 | set to | |
44 | .Dv EINTR . | |
45 | .Sh SEE ALSO | |
46 | .Xr sigprocmask 2 , | |
47 | .Xr sigaction 2 , | |
48 | .Xr sigsetops 3 | |
49 | .Sh STANDARDS | |
50 | The | |
faf7e3e0 | 51 | .Nm sigsupend |
931b8415 | 52 | function call |
faf7e3e0 CL |
53 | conforms to |
54 | .St -p1003.1-88 . |