sigsetops(3) Library Functions Manual sigsetops(3)Name
sigemptyset, sigfillset, sigaddset, sigdelset, sigismember - manipulate signal sets (POSIX)
Syntax
#include <signal.h>
int sigemptyset(set)
sigset_t *set;
int sigfillset (set)
sigset_t *set;
int sigaddset(set,sig)
sigset_t *set;
int sig;
int sigdelset(set,sig)
sigset_t *set;
int sig;
int sigismember(set,sig)
sigset_t *set;
int sig;
Description
The functions manipulate signal sets used by the other POSIX signal functions
The function initializes the signal set pointed to by the argument set so that all signals are excluded.
The function initializes the signal set pointed to by the argument set so that all signals are included.
The and functions respectively add and delete the individual signal specified by the value of the argument sig from the signal set pointed
to by the argument set.
The function tests whether the signal specified by the value of the argument sig is a member of the set pointed to by the argument set.
Return Values
Upon successful completion, the function returns a value of 1 if the specified signal is a member of the set. If it is not a member of the
set, a value of 0 is returned.
If the or functions fail a -1 value is returned and errno is set to indicate the reason.
Diagnostics
The function will fail and the signal mask will remain unchanged if one of the following occur:
[EINVAL] The value of the sig argument is not a valid signal number
See Alsosigprocmask(3), sigaction(3), sigsuspend(3), sigpending(2)sigsetops(3)
Check Out this Related Man Page
SIGSET(3) Library Functions Manual SIGSET(3)NAME
sigset, sigaddset, sigdelset, sigemptyset, sigfillset, sigismember - manipulate signal sets
SYNOPSIS
#include <signal.h>
int sigaddset(sigset_t *set, int sig)
int sigdelset(sigset_t *set, int sig)
int sigemptyset(sigset_t *set)
int sigfillset(sigset_t *set)
int sigismember(const sigset_t *set, int sig)
DESCRIPTION
The system calls that handle signals, such as sigaction(2) and sigprocmask(2) use sets of signals to keep a process from being interrupted
by those signals while executing a signal handler or a critical code segment. These signal sets are manipulated by the following func-
tions:
int sigaddset(sigset_t *set, int sig)
Add signal sig to the signal set referenced by set.
int sigdelset(sigset_t *set, int sig)
Remove signal sig from the signal set referenced by set.
int sigemptyset(sigset_t *set)
Initialize the signal set referenced by set to an empty set.
int sigfillset(sigset_t *set)
Initialize the signal set referenced by set to an full set, i.e. all signals are in the set.
int sigismember(const sigset_t *set, int sig)
Return 1 if the signal sig is present in the set referenced by set, 0 otherwise.
SEE ALSO sigaction(2), sigpending(2), sigprocmask(2), sigsuspend(2).
DIAGNOSTICS
All functions except sigismember return 0 on success. Sigismember returns 0 or 1 on success. They return -1 with error code EINVAL for an
invalid signal number. (They do not use EFAULT for a bad set address, but will simply cause a segmentation violation.)
AUTHOR
Kees J. Bot (kjb@cs.vu.nl)
SIGSET(3)
Hello,
i am using the sigaction function to handle the SIGCHLD signal.Is it possible to use a class member function as the handler function (the sa_handler member of the sigaction structure)?
The function's signature is:
void (*sa_handler)(int);so i don't think i can use a static member function... (2 Replies)
I know how to add signal to a set. But what if I want to add 2 or 3 signals to the set.
I know I can use sigaddset (&set,SIGBUS)....but what if I want to add SIGBUS and SIGALRM at once. Do i have to do it like this..
sigaddset (&set,SIGBUS);
sigaddset (&set,SIGALRM);
Is there another way to... (0 Replies)