Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

sigsuspend(2) OSS System Calls Reference Manual
NAME
sigsuspend - Changes the set of blocked signals and waits for a signal
LIBRARY
G-series native OSS processes: system library
H-series and J-series OSS processes: implicit libraries
32-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/zputdll
64-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/yputdll
SYNOPSIS
#include <signal.h>
int sigsuspend(
sigset_t *signal_mask );
PARAMETERS
signal_mask Points to a set of signals to be blocked from delivery to the calling process.
DESCRIPTION
The sigsuspend( ) function replaces the signal mask of the process with the set of signals pointed
to by the signal_mask parameter, and then suspends execution of the process until delivery of a
signal whose action is either to execute a signal-catching function or to terminate the process.
The sigsuspend( ) function does not allow the SIGKILL, SIGABEND,orSIGSTOP signals to
be blocked. If a program attempts to block one of these signals, the sigsuspend( ) function gives
no indication of an error.
If delivery of a signal causes the process to terminate, the sigsuspend( ) function does not return.
If delivery of a signal causes a signal-catching function to execute, the sigsuspend( ) function
returns after the signal-catching function returns, with the signal mask restored to the set that
existed prior to the call to the sigsuspend( ) function.
The sigsuspend( ) function sets the signal mask and waits for an unblocked signal as one atomic
operation. This means that signals cannot occur between the operations of setting the mask and
waiting for a signal.
In normal use, a signal is blocked by calling the sigprocmask(SIG_BLOCK) function at the
beginning of a critical section of code. The process then determines whether there is work for it
to do. If no work is to be done, the process waits for work by calling the sigsuspend( ) function
with the mask previously returned by the sigprocmask() function.
Use From a Threaded Application
The thread-aware sigsuspend( ) function replaces the current signal mask of a thread with the
signal set specified by the signal_mask parameter and suspends processing for the thread until
the thread receives one of the following signals:
SIGSTOP, SIGKILL,orSIGABEND.
A signal that is not a member of signal_mask and has an action that either calls a signal-
catching function, ends the request, or terminates the process.
The thread-aware signal is always enabled in the POSIX User Thread (PUT) library so that exter-
nally generated signals (such as SIGINT, SIGQUIT, SIGALRM, and SIGCHLD) are catchable
by threads.
7106 Hewlett-Packard Company 527186-023