1 .\" Copyright (c) 2005 David Xu <davidxu@FreeBSD.org>
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice(s), this list of conditions and the following disclaimer as
9 .\" the first lines of this file unmodified other than the possible
10 .\" addition of one or more copyright notices.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice(s), this list of conditions and the following disclaimer in
13 .\" the documentation and/or other materials provided with the
16 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
17 .\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
20 .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 .\" $FreeBSD: head/lib/libc/sys/sigwaitinfo.2 276006 2014-12-21 12:36:36Z brueffer $
34 .Nm sigtimedwait , sigwaitinfo
35 .Nd "wait for queued signals (REALTIME)"
42 .Fa "const sigset_t * restrict set" "siginfo_t * restrict info"
43 .Fa "const struct timespec * restrict timeout"
46 .Fn sigwaitinfo "const sigset_t * restrict set" "siginfo_t * restrict info"
50 system call is equivalent to
52 except that if none of the signals specified by
56 waits for the time interval specified in the
58 structure referenced by
62 structure pointed to by
64 is zero-valued and if none of the signals specified by
68 returns immediately with an error.
73 pointer, the behavior is unspecified.
75 .\".Dv CLOCK_MONOTONIC
76 .\"clock is used to measure the time interval specified by the
82 system call selects the pending signal from the set specified by
84 .\"Should any of multiple pending signals in the range
88 .\"be selected, it shall be the lowest numbered one.
90 .\"selection order between realtime and non-realtime signals, or
91 .\"between multiple pending non-realtime signals, is unspecified.
94 is pending at the time of the call, the calling thread
95 is suspended until one or more signals in
97 become pending or until it is interrupted by an unblocked, caught signal.
101 system call is equivalent to the
113 function is equivalent to
115 except that the selected signal number shall be stored in the
117 member, and the cause of the signal shall be stored in the
124 system calls may return
126 if interrupted by signal, which is not allowed for the
130 If any value is queued to the selected signal, the first such queued
131 value is dequeued and, if the info argument is
133 the value is stored in the
137 The system resource used to queue the signal
138 is released and returned to the system for other use.
139 If no value is queued,
142 member is zero-valued.
143 If no further signals are
144 queued for the selected signal, the pending indication for that signal
147 Upon successful completion (that is, one of the signals specified by
149 is pending or is generated)
153 return the selected signal number.
154 Otherwise, the functions return a value of \-1
155 and set the global variable
157 to indicate the error.
165 No signal specified by set was generated within the specified timeout period.
172 system calls fail if:
175 The wait was interrupted by an unblocked, caught signal.
180 system call may also fail if:
187 value less than zero or greater than or equal
189 Kernel only checks for this error if no signal is pending in set and it
190 is necessary to wait.
198 .Xr pthread_sigmask 3 ,
206 system calls conform to