Open System Services System Calls Reference Manual (G06.28+, H06.05+)
System Functions (s and S) spt_sigwait(2)
NAME
spt_sigwait - Causes the calling thread to wait for a signal
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/sysnn/zsptdll
SYNOPSIS
#include <spthread.h>
int spt_sigwait(
sigset_t *set
int *sig);
PARAMETERS
set specifies the set of signals that the calling thread will wait for.
sig receives the signal number cleared from the specified set of sig-
nal numbers.
DESCRIPTION
This function causes a thread to wait for a signal. It atomically chooses a pending signal from
the set of pending signals indicated by the set parameter, atomically clears that signal from the
system’s set of pending signals, and returns that signal number at the location specified by the sig
parameter. If no signal in set is pending at the time of the call, the thread is blocked until one or
more signals become pending. The signals defined by set should be unblocked during the call to
this function and are blocked when the thread returns from the call, unless another thread is
currently waiting for one of those signals.
A thread must block the signals it waits for using the pthread_sigmask() function before calling
this function.
If more than one thread is using this function to wait for the same signal, only one of those
threads returns from this function with the signal number.
A call to the spt_sigwait() function is a cancelation point.
To catch externally generated signals (such as SIGINT, SIGQUIT, SIGALRM, and SIGCHLD) at
the thread level, you must export the SPT_THREAD_AWARE_SIGNAL envronmental variable
to the value 1. By default, SPT_THREAD_AWARE_SIGNAL is disabled.
RETURN VALUES
On a successful call, the signal number is returned. If a call fails, [EINVAL] is returned.
RELATED INFORMATION
Functions: pause(2), pthread_cancel(2), pthread_sigmask(2), sigpending(2).
STANDARDS CONFORMANCE
This function is an extension to the XPG4 Version 2 specification. Interfaces documented on this
reference page conform to the following industry standards:
— IEEE Std 1003.1c-1995, POSIX System Application Program Interface
The HP implementation does not provide the spt_sigwaitinfo() or
sigtimedwait() functions.
The use of the header file spthread.h is an HP exception to the POSIX standard.
527186-007 Hewlett-Packard Company 7−321