1SIGSUSPEND(2)              Linux Programmer's Manual             SIGSUSPEND(2)
2
3
4

NAME

6       sigsuspend - wait for a signal
7

SYNOPSIS

9       #include <signal.h>
10
11       int sigsuspend(const sigset_t *mask);
12
13   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15       sigsuspend(): _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE
16

DESCRIPTION

18       sigsuspend()  temporarily  replaces  the  signal  mask  of  the calling
19       process with the mask given by mask and then suspends the process until
20       delivery  of  a signal whose action is to invoke a signal handler or to
21       terminate a process.
22
23       If the signal  terminates  the  process,  then  sigsuspend()  does  not
24       return.   If  the signal is caught, then sigsuspend() returns after the
25       signal handler returns, and the signal mask is restored  to  the  state
26       before the call to sigsuspend().
27
28       It  is  not possible to block SIGKILL or SIGSTOP; specifying these sig‐
29       nals in mask, has no effect on the process's signal mask.
30

RETURN VALUE

32       sigsuspend() always returns -1, normally with the error EINTR.
33

ERRORS

35       EFAULT mask points to memory which is not a valid part of  the  process
36              address space.
37
38       EINTR  The call was interrupted by a signal.
39

CONFORMING TO

41       POSIX.1-2001.
42

NOTES

44       Normally,  sigsuspend()  is  used in conjunction with sigprocmask(2) in
45       order to prevent delivery of a signal during the execution of a  criti‐
46       cal  code  section.   The caller first blocks the signals with sigproc‐
47       mask(2).  When the critical code has completed, the caller  then  waits
48       for  the  signals by calling sigsuspend() with the signal mask that was
49       returned by sigprocmask(2) (in the oldset argument).
50
51       See sigsetops(3) for details on manipulating signal sets.
52

SEE ALSO

54       kill(2), pause(2), sigaction(2),  signal(2),  sigprocmask(2),  sigwait‐
55       info(2), sigsetops(3), sigwait(3), signal(7)
56

COLOPHON

58       This  page  is  part of release 3.22 of the Linux man-pages project.  A
59       description of the project, and information about reporting  bugs,  can
60       be found at http://www.kernel.org/doc/man-pages/.
61
62
63
64Linux                             2008-08-29                     SIGSUSPEND(2)
Impressum