1SIGWAIT(3) Linux Programmer's Manual SIGWAIT(3)
2
3
4
6 sigwait - wait for a signal
7
9 #include <signal.h>
10
11 int sigwait(const sigset_t *set, int *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
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
35 On success, sigwait() returns 0. On error, it returns a positive error
36 number (listed in ERRORS).
37
39 EINVAL set contains an invalid signal number.
40
42 For an explanation of the terms used in this section, see
43 attributes(7).
44
45 ┌──────────┬───────────────┬─────────┐
46 │Interface │ Attribute │ Value │
47 ├──────────┼───────────────┼─────────┤
48 │sigwait() │ Thread safety │ MT-Safe │
49 └──────────┴───────────────┴─────────┘
51 POSIX.1-2001, POSIX.1-2008.
52
54 sigwait() is implemented using sigtimedwait(2).
55
56 The glibc implementation of sigwait() silently ignores attempts to wait
57 for the two real-time signals that are used internally by the NPTL
58 threading implementation. See nptl(7) for details.
59
61 See pthread_sigmask(3).
62
64 sigaction(2), signalfd(2), sigpending(2), sigsuspend(2), sigwait‐
65 info(2), sigsetops(3), signal(7)
66
68 This page is part of release 5.04 of the Linux man-pages project. A
69 description of the project, information about reporting bugs, and the
70 latest version of this page, can be found at
71 https://www.kernel.org/doc/man-pages/.
72
73
74
75Linux 2017-07-13 SIGWAIT(3)