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

sigprocmask(2) OSS System Calls Reference Manual
NAME
sigprocmask - Changes or examines the signal mask
LIBRARY
G-series native OSS processes: system library
H-series OSS processes: implicit libraries
SYNOPSIS
#include <signal.h>
int sigprocmask(
int how,
sigset_t *set,
sigset_t *o_set );
PARAMETERS
how Indicates the manner in which the set of masked signals is changed; it has one of
the following values:
SIG_BLOCK The resulting set is the union of the current set and the signal set
pointed to by the set parameter.
SIG_UNBLOCK
The resulting set is the current set less the signals indicated in
the signal set pointed to by the set parameter.
SIG_SETMASK
The resulting set is the signal set pointed to by the set parameter.
set Specifies the signal set. If the set parameter is not a null pointer, it points to a set
of signals to be used to change the currently blocked set. If the set parameter is a
null pointer, the value of the how parameter is not significant and the process sig-
nal mask is unchanged; thus, the call can be used to inquire about currently
blocked signals.
o_set Returns the existing signal mask. If the o_set parameter is not a null pointer, the
signal mask in effect at the time of the call is stored in the variable pointed to by
the o_set parameter.
DESCRIPTION
The sigprocmask() function is used to change or examine the signal mask of the calling process.
Typical use is to
1. Call the sigprocmask(SIG_BLOCK) function to block signals during a critical section
of code.
2. Call the sigprocmask(SIG_SETMASK) function at the end of the critical section of
code to restore the mask to the previous value returned by the
sigprocmask(SIG_BLOCK) function.
If there are any unblocked signals pending after a call to the sigprocmask() function, at least one
of those signals will be delivered before the sigprocmask() function returns.
The sigprocmask() function does not allow the SIGKILL, SIGABEND,orSIGSTOP signals
to be blocked. If a program attempts to block any of these signals, the sigprocmask() function
gives no indication of the error.
Any signal that is generated by an event other than the kill() or raise() function causes process
termination if the signal is blocked. If possible, a saveabend file is created.
7104 Hewlett-Packard Company 527186-023