1 .\" Copyright (c) 2002 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .TH SIGWAITINFO 2 2008-10-04 "Linux" "Linux Programmer's Manual"
25 sigwaitinfo, sigtimedwait \- synchronously wait for queued signals
28 .B #include <signal.h>
30 .BI "int sigwaitinfo(const sigset_t *" set ", siginfo_t *" info ");"
32 .BI "int sigtimedwait(const sigset_t *" set ", siginfo_t *" info ", "
33 .BI " const struct timespec *" timeout ");"
37 Feature Test Macro Requirements for glibc (see
38 .BR feature_test_macros (7)):
43 _POSIX_C_SOURCE\ >=\ 199309L
46 suspends execution of the calling thread until one of the signals in
49 (If one of the signals in
51 is already pending for the calling thread,
53 will return immediately with information about that signal.)
56 removes the delivered signal from the set of pending
57 signals and returns the signal number as its function result.
61 then it returns a structure of type
65 containing information about the signal.
69 are delivered in the usual order; see
74 operates in exactly the same way as
76 except that it has an additional argument,
78 which enables an upper bound to be placed on the time for which
79 the thread is suspended.
80 This argument is of the following type:
85 long tv_sec; /* seconds */
86 long tv_nsec; /* nanoseconds */
91 If both fields of this structure are specified as 0, a poll is performed:
93 returns immediately, either with information about a signal that
94 was pending for the caller, or with an error
95 if none of the signals in
103 return a signal number (i.e., a value greater than zero).
104 On failure both calls return \-1, with
106 set to indicate the error.
112 was delivered within the
118 The wait was interrupted by a signal handler; see
120 (This handler was for a signal other than one of those in
129 In normal usage, the calling program blocks the signals in
133 (so that the default disposition for these signals does not occur if they
134 are delivered between successive calls to
138 and does not establish handlers for these signals.
139 In a multithreaded program,
140 the signal should be blocked in all threads to prevent
141 the signal being delivered to a thread other than the one calling
144 .BR sigtimedwait ()).
146 The set of signals that is pending for a given thread is the
147 union of the set of signals that is pending specifically for that thread
148 and the set of signals that is pending for the process as a whole (see
151 If multiple threads of a process are blocked
152 waiting for the same signal(s) in
156 then exactly one of the threads will actually receive the
157 signal if it is delivered to the process as a whole;
158 which of the threads receives the signal is indeterminate.
160 POSIX leaves the meaning of a NULL value for the
164 unspecified, permitting the possibility that this has the same meaning
167 and indeed this is what is done on Linux.
171 is a library function implemented on top of