Chapter Contents |
Previous |
Next |
sigaddset, sigdelset, sigemptyset, sigfillset, sigismember |
Portability: | POSIX.1 conforming |
SYNOPSIS | |
DESCRIPTION | |
RETURN VALUE | |
EXAMPLE | |
SEE ALSO |
SYNOPSIS |
#include <lcsignal.h> int sigaddset(sigset_t *set, int signum); int sigdelset(sigset_t *set, int signum); int sigemptyset(sigset_t *set); int sigfillset(sigset_t *set); int sigismember(const sigset_t *set, int signum);
For the POSIX implementation,
include the header file
<signal.h>
after
defining an appropriate feature test macro.
DESCRIPTION |
sigaddset
,
sigdelset
,
sigemptyset
,
sigfillset
, and
sigismember
enable you to modify the
sigset_t
object addressed by
set
.
The
sigset_t
function is defined in
<signal.h>
and
<lcsignal.h>
as a type representing a collection of signal numbers.
Signal sets are passed as arguments to other signal handling functions, such
as
sigprocmask
,
sigpending
, and
oesigsetup
.
The functions that modify signals in a set of signals include
sigaddset
|
adds the signal
signum
to the set. |
sigdelset
|
deletes the signal
signum
from the set. |
sigemptyset
|
initializes a set to contain no signals. |
sigfillset
|
initializes a set to contain all signals. |
sigismember
|
tests to see if
signum
is a member of the set. |
RETURN VALUE |
sigismember
returns 1 if
signum
is a member
of the set, or 0 if it is not in the set. All other functions return 0 if
successful. All functions return -1 if an error occurs (such as an invalid
signal number).
EXAMPLE |
The following example uses these functions
to set up signal sets for
oesigsetup
.
The call to
oesigsetup
defines
SIGALRM
and
SIGFPE
as signals managed
by SAS/C, and all others as signals managed by USS. See the
sigpending
example for an example using
sigismember
.
#include <lcsignal.h> sigset_t sascset, oeset; sigemptyset(&sascset); sigaddset(&sascset, SIGFPE); /* SAS/C will manage SIGALRM and SIGFPE. */ sigaddset(&sascser, SIGALRM); sigfillset(&oeset); sigdelset(&oeset, SIGFPE); /* OpenEdition manages everything else */ /* (whenever possible). */ sigdelset(&oeset, SIGALRM); oesigsetup(&oeset, &sascset);
SEE ALSO |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.