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

OSS Library Calls (s) sigaddset(3)
NAME
sigaddset - Adds a signal to a signal set
LIBRARY
G-series native OSS processes: system library
H-series and J-series OSS processes: implicit libraries
SYNOPSIS
#include <signal.h>
int sigaddset(
sigset_t *set,
int sig_number );
PARAMETERS
set Points to the signal set to be modified.
sig_number Specifies the signal to be added to the set.
DESCRIPTION
The sigaddset( ) function adds the individual signal specified by the sig_number parameter to the
signal set pointed to by the set parameter.
This function operates on data objects that can be addressed by the application, not on any set of
signals known to the system. This function is not for operating on the set of signals blocked from
delivery to a process or the set pending for a process.
A call to either the sigfillset( ) or sigemptyset( ) function must be made at least once for each
object of the type sigset_t before the sigaddset( ) function is used on that set. If the object is
used without such initialization, the results are undefined.
EXAMPLES
The following example shows how to generate and use a signal mask that blocks only the SIG-
INT signal from delivery.
#include <signal.h>
int return_value;
sigset_t newset;
sigset_t *newset_p;
...
newset_p = &newset;
sigemptyset(newset_p);
sigaddset(newset_p, SIGINT);
return_value = sigprocmask (SIG_SETMASK, newset_p, NULL);
RETURN VALUES
Upon successful completion, the sigaddset( ) function returns the value 0 (zero). If an error is
detected, the value -1 is returned and errno is set to indicate the error.
ERRORS
If the following condition occurs, the sigaddset( ) function sets errno to the corresponding value:
[EINVAL] The value of the sig_number parameter is an invalid or unsupported signal
number.
527187-017 Hewlett-Packard Company 649