]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/sigwait.3
man*/: ffix (un-bracket tables)
[thirdparty/man-pages.git] / man3 / sigwait.3
CommitLineData
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
9sigwait \- wait for a signal
148676bc
AC
10.SH LIBRARY
11Standard 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
21Feature 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
33The
34.BR sigwait ()
5011ecfd
MK
35function suspends execution of the calling thread until
36one of the signals specified in the signal set
1ae6b2c7 37.I set
5011ecfd 38becomes pending.
e95c1726
MK
39The function accepts the signal
40(removes it from the pending list of signals),
41and returns the signal number in
a3dadfe8 42.IR sig .
26bab9df 43.PP
e95c1726
MK
44The operation of
45.BR sigwait ()
46is the same as
0b80cf56 47.BR sigwaitinfo (2),
e95c1726 48except that:
cdede5cd 49.IP \[bu] 3
e95c1726 50.BR sigwait ()
33a0ccb2 51returns only the signal number, rather than a
e95c1726
MK
52.I siginfo_t
53structure describing the signal.
cdede5cd 54.IP \[bu]
e95c1726
MK
55The return values of the two functions are different.
56.SH RETURN VALUE
57On success,
58.BR sigwait ()
59returns 0.
535f0df5 60On 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
66contains an invalid signal number.
598a7a2d 67.SH ATTRIBUTES
8e09ed53
PH
68For an explanation of the terms used in this section, see
69.BR attributes (7).
70.TS
71allbox;
c466875e 72lbx lb lb
8e09ed53
PH
73l l l.
74Interface Attribute Value
75T{
9e54434e
BR
76.na
77.nh
598a7a2d 78.BR sigwait ()
8e09ed53
PH
79T} Thread safety MT-Safe
80.TE
c466875e 81.sp 1
4131356c 82.SH VERSIONS
e95c1726
MK
83.BR sigwait ()
84is implemented using
85.BR sigtimedwait (2).
26bab9df 86.PP
4ff3769f
MK
87The glibc implementation of
88.BR sigwait ()
89silently ignores attempts to wait for the two real-time signals that
90are used internally by the NPTL threading implementation.
91See
92.BR nptl (7)
93for details.
4131356c
AC
94.SH STANDARDS
95POSIX.1-2008.
96.SH HISTORY
97POSIX.1-2001.
a14af333 98.SH EXAMPLES
cf499212
MK
99See
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)