.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
-.TH SIGWAITINFO 2 2017-05-03 "Linux" "Linux Programmer's Manual"
+.TH SIGWAITINFO 2 2017-09-15 "Linux" "Linux Programmer's Manual"
.SH NAME
sigwaitinfo, sigtimedwait, rt_sigtimedwait \- synchronously wait
for queued signals
.SH SYNOPSIS
.nf
.B #include <signal.h>
-.sp
+.PP
.BI "int sigwaitinfo(const sigset_t *" set ", siginfo_t *" info ");"
-.sp
+.PP
.BI "int sigtimedwait(const sigset_t *" set ", siginfo_t *" info ", "
.BI " const struct timespec *" timeout ");"
.fi
-.sp
+.PP
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
-.sp
+.PP
.BR sigwaitinfo (),
.BR sigtimedwait ():
_POSIX_C_SOURCE\ >=\ 199309L
is already pending for the calling thread,
.BR sigwaitinfo ()
will return immediately.)
-
+.PP
.BR sigwaitinfo ()
removes the signal from the set of pending
signals and returns the signal number as its function result.
and kernel scheduling delays mean that the interval
may overrun by a small amount.)
This argument is of the following type:
-.sp
+.PP
.in +4n
-.nf
+.EX
struct timespec {
long tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
}
-.fi
+.EE
.in
-.sp
+.PP
If both fields of this structure are specified as 0, a poll is performed:
.BR sigtimedwait ()
returns immediately, either with information about a signal that
.BR sigwaitinfo ()
or
.BR sigtimedwait ()).
-
+.PP
The set of signals that is pending for a given thread is the
union of the set of signals that is pending specifically for that thread
and the set of signals that is pending for the process as a whole (see
.BR signal (7)).
-
+.PP
Attempts to wait for
.B SIGKILL
and
.B SIGSTOP
are silently ignored.
-
+.PP
If multiple threads of a process are blocked
waiting for the same signal(s) in
.BR sigwaitinfo ()
then exactly one of the threads will actually receive the
signal if it becomes pending for the process as a whole;
which of the threads receives the signal is indeterminate.
-
+.PP
.BR sigwaitinfo ()
or
.BR sigtimedwait (),
.BR SIGFPE
signal that results from an arithmetic error.
Such signals can be caught only via signal handler.
-
+.PP
POSIX leaves the meaning of a NULL value for the
.I timeout
argument of
.BR sigwaitinfo ()
is a library function implemented on top of
.BR sigtimedwait ().
-
+.PP
The glibc wrapper functions for
.BR sigwaitinfo ()
and
See
.BR nptl (7)
for details.
-
+.PP
The original Linux system call was named
.BR sigtimedwait ().
However, with the addition of real-time signals in Linux 2.2,