]>
Commit | Line | Data |
---|---|---|
a1eaacb1 | 1 | '\" t |
e95c1726 MK |
2 | .\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk |
3 | .\" <mtk.manpages@gmail.com> | |
4 | .\" | |
5fbde956 | 5 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
e95c1726 | 6 | .\" |
4c1c5274 | 7 | .TH sigwait 3 (date) "Linux man-pages (unreleased)" |
e95c1726 MK |
8 | .SH NAME |
9 | sigwait \- wait for a signal | |
148676bc AC |
10 | .SH LIBRARY |
11 | Standard C library | |
8fc3b2cf | 12 | .RI ( libc ", " \-lc ) |
e95c1726 MK |
13 | .SH SYNOPSIS |
14 | .nf | |
15 | .B #include <signal.h> | |
dbfe9c70 | 16 | .PP |
0b3f94cb | 17 | .BI "int sigwait(const sigset_t *restrict " set ", int *restrict " sig ); |
e95c1726 | 18 | .fi |
26bab9df | 19 | .PP |
d39ad78f | 20 | .RS -4 |
0f200f07 MK |
21 | Feature Test Macro Requirements for glibc (see |
22 | .BR feature_test_macros (7)): | |
d39ad78f | 23 | .RE |
68e4db0a | 24 | .PP |
0f200f07 | 25 | .BR sigwait (): |
9d2adbae MK |
26 | .nf |
27 | Since glibc 2.26: | |
28 | _POSIX_C_SOURCE >= 199506L | |
75c018a1 | 29 | glibc 2.25 and earlier: |
9d2adbae MK |
30 | _POSIX_C_SOURCE |
31 | .fi | |
e95c1726 MK |
32 | .SH DESCRIPTION |
33 | The | |
34 | .BR sigwait () | |
5011ecfd MK |
35 | function suspends execution of the calling thread until |
36 | one of the signals specified in the signal set | |
1ae6b2c7 | 37 | .I set |
5011ecfd | 38 | becomes pending. |
e95c1726 MK |
39 | The function accepts the signal |
40 | (removes it from the pending list of signals), | |
41 | and returns the signal number in | |
a3dadfe8 | 42 | .IR sig . |
26bab9df | 43 | .PP |
e95c1726 MK |
44 | The operation of |
45 | .BR sigwait () | |
46 | is the same as | |
0b80cf56 | 47 | .BR sigwaitinfo (2), |
e95c1726 | 48 | except that: |
cdede5cd | 49 | .IP \[bu] 3 |
e95c1726 | 50 | .BR sigwait () |
33a0ccb2 | 51 | returns only the signal number, rather than a |
e95c1726 MK |
52 | .I siginfo_t |
53 | structure describing the signal. | |
cdede5cd | 54 | .IP \[bu] |
e95c1726 MK |
55 | The return values of the two functions are different. |
56 | .SH RETURN VALUE | |
57 | On success, | |
58 | .BR sigwait () | |
59 | returns 0. | |
535f0df5 | 60 | On error, it returns a positive error number (listed in ERRORS). |
e95c1726 MK |
61 | .SH ERRORS |
62 | .TP | |
63 | .B EINVAL | |
64 | .\" Does not occur for glibc. | |
65 | .I set | |
66 | contains an invalid signal number. | |
598a7a2d | 67 | .SH ATTRIBUTES |
8e09ed53 PH |
68 | For an explanation of the terms used in this section, see |
69 | .BR attributes (7). | |
70 | .TS | |
71 | allbox; | |
c466875e | 72 | lbx lb lb |
8e09ed53 PH |
73 | l l l. |
74 | Interface Attribute Value | |
75 | T{ | |
9e54434e BR |
76 | .na |
77 | .nh | |
598a7a2d | 78 | .BR sigwait () |
8e09ed53 PH |
79 | T} Thread safety MT-Safe |
80 | .TE | |
c466875e | 81 | .sp 1 |
4131356c | 82 | .SH VERSIONS |
e95c1726 MK |
83 | .BR sigwait () |
84 | is implemented using | |
85 | .BR sigtimedwait (2). | |
26bab9df | 86 | .PP |
4ff3769f MK |
87 | The glibc implementation of |
88 | .BR sigwait () | |
89 | silently ignores attempts to wait for the two real-time signals that | |
90 | are used internally by the NPTL threading implementation. | |
91 | See | |
92 | .BR nptl (7) | |
93 | for details. | |
4131356c AC |
94 | .SH STANDARDS |
95 | POSIX.1-2008. | |
96 | .SH HISTORY | |
97 | POSIX.1-2001. | |
a14af333 | 98 | .SH EXAMPLES |
cf499212 MK |
99 | See |
100 | .BR pthread_sigmask (3). | |
e95c1726 | 101 | .SH SEE ALSO |
e95c1726 MK |
102 | .BR sigaction (2), |
103 | .BR signalfd (2), | |
104 | .BR sigpending (2), | |
105 | .BR sigsuspend (2), | |
106 | .BR sigwaitinfo (2), | |
107 | .BR sigsetops (3), | |
108 | .BR signal (7) |