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, with errno set to inndicate  the  error
33       (normally, EINTR).
34

ERRORS

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

CONFORMING TO

42       POSIX.1-2001.
43

NOTES

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

SEE ALSO

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

COLOPHON

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