SIGSETOPS(3V)

NAME
sigsetops, sigaddset, sigdelset, sigfillset, sigemptyset, sigismember - manipulate signal sets

SYNOPSIS

#include <signal.h>

int sigaddset(set, signo)
sigset_t *set;
int signo;

int sigdelset(set, signo)
sigset_t *set;
int signo;

int sigfillset(set)
sigset_t *set;

int sigemptyset(set)
sigset_t *set;

int sigismember(set, signo)
sigset_t *set
int signo;

DESCRIPTION

The sigsetops primitives manipulate sets of signals. They operate on data objects addressable by the application. They do not operate on any set of signals known to the system, such as the set blocked from delivery to a process or the set pending for a process.

sigaddset() and sigdelset() respectively add and delete the individual signal specified by the value of signo from the signal set pointed to by set.

sigemptyset() initializes the signal set pointed to by set such that all signals defined in this standard are excluded.

sigfillset() initializes the signal set pointed to by set such that all signals defined in this standard are included.

Applications shall call either sigemptyset() or sigfillset() at least once for each object of type sigset_t prior to any other use of that object. If such an object is not initialized in this way, but is nonetheless supplied as an argument to any of sigaddset(), sigdelset(), sigismember(), sigaction(), sigprocmask(), sigpending(), or sigsuspend() the results are undefined.

sigismember() tests whether the signal specified by the value of signo is a member of the set pointed to by set.

RETURN VALUES

sigismember() returns:

1   if the specified signal is a member of set.

0   if the specified signal is not a member of set.

-1  if an error is detected, and sets errno to indicate the error.

The other functions return:

0   on success.

-1  on failure and set errno to indicate the error.

ERRORS

For each of the following conditions, if the condition is detected, sigaddset(), sigdelset(), and sigismember() set errno to:

EINVAL
    signo is an invalid or unsupported signal number.

SEE ALSO

sigaction(3V), sigpending(2V), sigprocmask(2V)