1 .\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk
2 .\" <mtk.manpages@gmail.com>
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .TH SIGWAIT 3 2021-03-22 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
8 sigwait \- wait for a signal
11 .RI ( libc ", " \-lc )
14 .B #include <signal.h>
16 .BI "int sigwait(const sigset_t *restrict " set ", int *restrict " sig );
20 Feature Test Macro Requirements for glibc (see
21 .BR feature_test_macros (7)):
27 _POSIX_C_SOURCE >= 199506L
28 Glibc 2.25 and earlier:
34 function suspends execution of the calling thread until
35 one of the signals specified in the signal set
38 The function accepts the signal
39 (removes it from the pending list of signals),
40 and returns the signal number in
50 returns only the signal number, rather than a
52 structure describing the signal.
54 The return values of the two functions are different.
59 On error, it returns a positive error number (listed in ERRORS).
63 .\" Does not occur for glibc.
65 contains an invalid signal number.
67 For an explanation of the terms used in this section, see
75 Interface Attribute Value
78 T} Thread safety MT-Safe
84 POSIX.1-2001, POSIX.1-2008.
90 The glibc implementation of
92 silently ignores attempts to wait for the two real-time signals that
93 are used internally by the NPTL threading implementation.
99 .BR pthread_sigmask (3).