|__THRSIGDIVERT(2)||System Calls Manual||__THRSIGDIVERT(2)|
synchronously accept a signal
*info, const struct
__thrsigdivert() function is used to
sigwait(). It selects a signal pending for
the calling thread or process from set, atomically
clears it from that set of pending signals, and returns that signal number.
If prior to the call to
__thrsigdivert() there are
multiple pending instances of a single signal number, it is undefined
whether upon successful return there are any remaining pending signals for
that signal number. If no signal in set is pending at
the time of the call, the thread shall be suspended until one or more
becomes pending. The signals defined by set should
have been blocked in all threads in the process at the time of the call to
__thrsigdivert(); otherwise the signal may be
delivered to some thread that does not have it blocked.
If more than one thread is using
__thrsigdivert() to wait for the same signal, no
more than one of these threads shall return from
__thrsigdivert() for any given signal that is sent.
Which thread returns from
__thrsigdivert() if more
than a single thread is waiting is unspecified.
If the info argument is not
NULL, then a siginfo_t will be
stored there which has the selected signal number in its
si_signo member and the cause of the signal in its
If the timeout argument is not
NULL and no selected signal is currently pending,
__thrsigdivert() will wait no longer than the
specified time period for a signal to arrive before failing.
If successful, the number of the signal that was accepted is
returned. Otherwise, a value of -1 is returned and
errno is set to indicate the error.
__thrsigdivert() will succeed unless:
__thrsigdivert() function is specific
to OpenBSD and should not be used in portable
thrsigdivert() syscall appeared in
OpenBSD 3.9. The info and
timeout arguments were added in
|August 21, 2016||OpenBSD-current|