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

NAME

6       sigwait - wait for a signal
7

SYNOPSIS

9       #include <signal.h>
10
11       int sigwait(const sigset_t *restrict set, int *restrict sig);
12
13   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15       sigwait():
16           Since glibc 2.26:
17               _POSIX_C_SOURCE >= 199506L
18           Glibc 2.25 and earlier:
19               _POSIX_C_SOURCE
20

DESCRIPTION

22       The  sigwait()  function suspends execution of the calling thread until
23       one of the signals specified in the signal  set  set  becomes  pending.
24       The  function  accepts  the signal (removes it from the pending list of
25       signals), and returns the signal number in sig.
26
27       The operation of sigwait() is the same as sigwaitinfo(2), except that:
28
29       * sigwait() returns only the signal number,  rather  than  a  siginfo_t
30         structure describing the signal.
31
32       * The return values of the two functions are different.
33

RETURN VALUE

35       On success, sigwait() returns 0.  On error, it returns a positive error
36       number (listed in ERRORS).
37

ERRORS

39       EINVAL set contains an invalid signal number.
40

ATTRIBUTES

42       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
43       tributes(7).
44
45       ┌────────────────────────────────────────────┬───────────────┬─────────┐
46Interface                                   Attribute     Value   
47       ├────────────────────────────────────────────┼───────────────┼─────────┤
48sigwait()                                   │ Thread safety │ MT-Safe │
49       └────────────────────────────────────────────┴───────────────┴─────────┘
50

CONFORMING TO

52       POSIX.1-2001, POSIX.1-2008.
53

NOTES

55       sigwait() is implemented using sigtimedwait(2).
56
57       The glibc implementation of sigwait() silently ignores attempts to wait
58       for the two real-time signals that are  used  internally  by  the  NPTL
59       threading implementation.  See nptl(7) for details.
60

EXAMPLES

62       See pthread_sigmask(3).
63

SEE ALSO

65       sigaction(2),  signalfd(2),  sigpending(2),  sigsuspend(2),  sigwaitin‐
66       fo(2), sigsetops(3), signal(7)
67

COLOPHON

69       This page is part of release 5.12 of the Linux  man-pages  project.   A
70       description  of  the project, information about reporting bugs, and the
71       latest    version    of    this    page,    can     be     found     at
72       https://www.kernel.org/doc/man-pages/.
73
74
75
76Linux                             2021-03-22                        SIGWAIT(3)
Impressum