Open System Services System Calls Reference Manual (G06.25+, H06.03+)
System Functions (s and S) sigsuspend(2)
NAME
sigsuspend - Changes the set of blocked signals and waits for a signal
LIBRARY
G-series native OSS processes: system library
H-series OSS processes: implicit libraries
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 the Guardian Environment
If called from a TNS or accelerated Guardian process, the actions of this function are undefined
and errno is set to [ENOTOSS].
RETURN VALUES
If a signal is caught by the calling process and control is returned from the signal-catching func-
tion, the calling process resumes execution after the sigsuspend( ) function, which always returns
the value -1 and, after finishing normally, sets errno to [EINTR].
ERRORS
If any of the following conditions occur, the sigsuspend() function sets errno to the correspond-
ing value:
[EINTR] The sigsuspend( ) function was interrupted by a signal that was caught by the
calling process, and control was returned from the signal-catching function.
[ENOTOSS] The calling process was not an OSS process or a native Guardian process. This
function cannot be used in the Guardian environment by a TNS or accelerated
process.
If the signal_mask parameter points to an invalid location, the sigsuspend() function generates
an unspecified signal that cannot be blocked or ignored and sends the signal to the process.
527186-003 Hewlett-Packard Company 7−67