1SIGSUSPEND(P)              POSIX Programmer's Manual             SIGSUSPEND(P)
2
3
4

NAME

6       sigsuspend - wait for a signal
7

SYNOPSIS

9       #include <signal.h>
10
11       int sigsuspend(const sigset_t *sigmask);
12
13

DESCRIPTION

15       The  sigsuspend() function shall replace the current signal mask of the
16       calling thread with the set of signals pointed to by sigmask  and  then
17       suspend the thread until delivery of a signal whose action is either to
18       execute a signal-catching function or to terminate  the  process.  This
19       shall  not  cause  any  other signals that may have been pending on the
20       process to become pending on the thread.
21
22       If the action is to terminate the process then sigsuspend() shall never
23       return.  If  the  action is to execute a signal-catching function, then
24       sigsuspend() shall return after the signal-catching  function  returns,
25       with the signal mask restored to the set that existed prior to the sig‐
26       suspend() call.
27
28       It is not possible to block signals that cannot  be  ignored.  This  is
29       enforced by the system without causing an error to be indicated.
30

RETURN VALUE

32       Since  sigsuspend() suspends thread execution indefinitely, there is no
33       successful completion return value. If a return  occurs,  -1  shall  be
34       returned and errno set to indicate the error.
35

ERRORS

37       The sigsuspend() function shall fail if:
38
39       EINTR  A  signal  is  caught  by  the  calling  process  and control is
40              returned from the signal-catching function.
41
42
43       The following sections are informative.
44

EXAMPLES

46       None.
47

APPLICATION USAGE

49       Normally, at the beginning of a critical code section, a specified  set
50       of  signals  is  blocked  using  the  sigprocmask() function.  When the
51       thread has completed the critical section and needs  to  wait  for  the
52       previously  blocked  signal(s),  it pauses by calling sigsuspend() with
53       the mask that was returned by the sigprocmask() call.
54

RATIONALE

56       None.
57

FUTURE DIRECTIONS

59       None.
60

SEE ALSO

62       Signal Concepts , pause() , sigaction() , sigaddset() ,  sigdelset()  ,
63       sigemptyset()   ,   sigfillset()  ,  the  Base  Definitions  volume  of
64       IEEE Std 1003.1-2001, <signal.h>
65
67       Portions of this text are reprinted and reproduced in  electronic  form
68       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
69       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
70       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
71       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
72       event of any discrepancy between this version and the original IEEE and
73       The Open Group Standard, the original IEEE and The Open Group  Standard
74       is  the  referee document. The original Standard can be obtained online
75       at http://www.opengroup.org/unix/online.html .
76
77
78
79IEEE/The Open Group                  2003                        SIGSUSPEND(P)
Impressum