1
0
Files
irix-657m-src/eoe/man/man3/sigsetops.3
2022-09-29 17:59:04 +03:00

173 lines
4.4 KiB
Groff

'\"macro stdmacro
.TH SIGSETOPS 3
.UC 4
.ie t .ds d \(dg
.el .ds d \z'|+'
.ie t .ds b \(bu
.el .ds b @
.SH NAME
sigsetops: sigaddset, sigdelset, sigemptyset, sigfillset, sigismember,
sgi_altersigs, sgi_sigffset, sgi_siganyset, sgi_dumpset \- signal
set manipulation and examination routines (\s-1POSIX\s+1, with \s-1SGI\s+1-specific additions)
.SH SYNOPSIS
.nf
.ti -2
.SM
.IR POSIX
.B "#include <signal.h>"
.PP
.B "int sigaddset(sigset_t *set, int sig);"
.PP
.B "int sigdelset(sigset_t *set, int sig);"
.PP
.B "int sigemptyset(sigset_t *set);"
.PP
.B "int sigfillset(sigset_t *set);"
.PP
.B "int sigismember(sigset_t *set, int sig);"
.PP
.ti -2
.SM
.IR SGI
.B "int sgi_altersigs(int action, sigset_t *set, int sigarray[]);"
.PP
.B "int sgi_sigffset(sigset_t *set, int clearit);"
.PP
.B "int sgi_siganyset(sigset_t *set);"
.PP
.B "int sgi_dumpset(sigset_t *set);"
.fi
.SH DESCRIPTION
.PP
These library calls modify or return information about the disposition
of the signal mask pointed to by
.I set.
The system defines a set of signals that may be delivered to a process.
Signal delivery resembles the occurrence of a hardware interrupt:
the signal is blocked from further occurrence, the current process
context is saved, and a new one is built. A global
.I "signal mask"
defines the set of signals currently blocked from delivery
to a process; it may be changed with a
.IR sigprocmask (2)
call. The masks submitted as parameters to
\f2sigprocmask\fP, \f2sigaction\fP, and \f2sigsuspend\fP and
returned by \f2sigpending\fP may be constructed, altered, and examined
via the sigsetops described in this man page. They
do \f2\s-1NOT\s+1\fP themselves
alter the global signal mask. The masks that the routines manipulate
are of type
.I sigset_t.
.PP
.I sigaddset
adds
.I sig
to the specified set.
.PP
.I sigdelset
deletes
.I sig
from the specified set.
.PP
.I sigemptyset
clears all signals in the specified set.
.PP
.I sigfillset
sets all signals in the specified set.
.PP
.I sigismember
returns 1 if
.I sig
is a member of the specified set, else returns 0.
.SH SGI-SPECIFIC FUNCTIONS
The following four functions, although
.I not
part of the
.SM POSIX
specification, provide additional capabilities:
.PP
.I sgi_altersigs
performs
.I action
on the specified signal set, for each signal in
.I sigarray.
.I Action
may be \s-1ADDSIGS\s+1 or \s-1DELSIGS\s+1 (defined
in <\f2sys/signal.h\fP).
The final signal entry in
.I sigarray
must be followed by a 0 entry (in this way
.I sgi_altersigs
knows how many signals to process). The array may include all legal
signals; however, if the intent is to set or clear all signals the
.I sigaddset
and
.I sigdelset
routines are more efficient. Any illegal signal numbers are silently
skipped.
.I sgi_altersigs
returns the number of signals which
were processed, or \-1 with
.I errno
set to \f3\s-1[EINVAL]\s+1\fP if
.I action
is not \s-1ADDSIGS\s+1 or \s-1DELSIGS\s+1.
.PP
.I sgi_sigffset
returns the number of the lowest pending signal in
.I set.
If none are pending, it returns 0. If
.I clearit
is non-zero, the returned signal is cleared in the mask. In this way
.I sgi_sigffset
may be used to sequentially examine the signals in a mask
without duplication.
.PP
.I sgi_siganyset(set)
returns 1 if
.I any
signals are set in the specified mask, otherwise it returns 0. The
mask is not altered.
.PP
.I sgi_dumpset
displays the specified set of signals as a bit-vector, primarily
for debugging purposes.
.PP
For a list of valid signal numbers please see \f4signal\fP(5).
.SH ERRORS
In every routine, the
.I set
parameter is a
.I pointer
to sigset_t.
All of these functions are library routines (executing in user space);
therefore if they are passed a
.SM
.I REFERENCE
to
.I set
instead of a
.SM
.I POINTER,
the compiler will issue a warning,
and when the program is run the process will receive a memory
fault signal [\f3\s-1SIGSEGV\s+1\fP] and
terminate (unless the process has installed a handler
for \f3\s-1SIGSEGV\s+1\fP).
.PP
All routines which require a
.I sig
parameter will fail, returning \-1 and setting
.I errno
to \f3\s-1[EINVAL]\s+1\fP if
.I sig
is not a valid signal number.
.SH "SEE ALSO"
sigaction(2), sigprocmask(2), sigpending(2), sigsuspend(2), sigsetjmp(3),
pthread_sigmask(3P).
.SH "WARNING"
The \s-1POSIX\s+1 and System V signal facilities have different semantics.
Using both facilities in the same program is \f3strongly discouraged\fP
and will result in unpredictable behavior.