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 | .\" @(#)sigsuspend.2 6.2 (Berkeley) %G% |
87714767 | 7 | .\" |
931b8415 CL |
8 | .Dd |
9 | .Dt SIGSUSPEND 2 | |
10 | .Os BSD 4.4 | |
11 | .Sh NAME | |
12 | .Nm sigsuspend | |
13 | .Nd atomically release blocked signals and wait for interrupt | |
14 | .Sh SYNOPSIS | |
15 | .Fd #include <sys/signal.h> | |
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 | |
51 | .Fn sigsupend | |
52 | function call | |
53 | conforms to IEEE Std 1003.1-1988 | |
54 | .Pq Dq Tn POSIX . |