]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/sigwait.3
psignal.3: ffix
[thirdparty/man-pages.git] / man3 / sigwait.3
CommitLineData
e95c1726
MK
1.\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk
2.\" <mtk.manpages@gmail.com>
3.\"
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
7.\"
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
12.\"
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date. The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
16.\" the use of the information contained herein. The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
20.\"
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
23.\"
535f0df5 24.TH SIGWAIT 3 2010-09-10 "Linux" "Linux Programmer's Manual"
e95c1726
MK
25.SH NAME
26sigwait \- wait for a signal
27.SH SYNOPSIS
28.nf
29.B #include <signal.h>
30
31.BI " int sigwait(const sigset_t *" set ", int *" sig );
32.fi
0f200f07
MK
33.sp
34.in -4n
35Feature Test Macro Requirements for glibc (see
36.BR feature_test_macros (7)):
37.in
38.sp
39.ad l
40.BR sigwait ():
41_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE
42.ad b
e95c1726
MK
43.SH DESCRIPTION
44The
45.BR sigwait ()
8018ea09
MK
46function suspends execution of the calling thread until the
47delivery of one of the signals specified in the signal set
e95c1726
MK
48.IR set .
49The function accepts the signal
50(removes it from the pending list of signals),
51and returns the signal number in
a3dadfe8 52.IR sig .
e95c1726
MK
53
54The operation of
55.BR sigwait ()
56is the same as
57.BR sigwaitinfo (),
58except that:
59.IP * 2
60.BR sigwait ()
61only returns the signal number, rather than a
62.I siginfo_t
63structure describing the signal.
64.IP *
65The return values of the two functions are different.
66.SH RETURN VALUE
67On success,
68.BR sigwait ()
69returns 0.
535f0df5 70On error, it returns a positive error number (listed in ERRORS).
e95c1726
MK
71.SH ERRORS
72.TP
73.B EINVAL
74.\" Does not occur for glibc.
75.I set
76contains an invalid signal number.
77.SH CONFORMING TO
78POSIX.1-2001.
79.SH NOTES
80.BR sigwait ()
81is implemented using
82.BR sigtimedwait (2).
cf499212
MK
83.SH EXAMPLES
84See
85.BR pthread_sigmask (3).
e95c1726 86.SH SEE ALSO
e95c1726
MK
87.BR sigaction (2),
88.BR signalfd (2),
89.BR sigpending (2),
90.BR sigsuspend (2),
91.BR sigwaitinfo (2),
92.BR sigsetops (3),
93.BR signal (7)