335 lines
6.0 KiB
HTML
335 lines
6.0 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SIGSETOPS</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SIGSETOPS</H1>
|
|
Section: Linux Programmer's Manual (3)<BR>Updated: 2016-03-15<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
sigemptyset, sigfillset, sigaddset, sigdelset, sigismember - POSIX
|
|
signal set operations
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>#include <<A HREF="file:///usr/include/signal.h">signal.h</A>></B>
|
|
|
|
<P>
|
|
|
|
<B>int sigemptyset(sigset_t *</B><I>set</I><B>);</B>
|
|
|
|
<P>
|
|
|
|
<B>int sigfillset(sigset_t *</B><I>set</I><B>);</B>
|
|
|
|
<P>
|
|
|
|
<B>int sigaddset(sigset_t *</B><I>set</I><B>, int </B><I>signum</I><B>);</B>
|
|
|
|
<P>
|
|
|
|
<B>int sigdelset(sigset_t *</B><I>set</I><B>, int </B><I>signum</I><B>);</B>
|
|
|
|
<P>
|
|
|
|
<B>int sigismember(const sigset_t *</B><I>set</I><B>, int </B><I>signum</I><B>);</B>
|
|
|
|
<P>
|
|
|
|
|
|
Feature Test Macro Requirements for glibc (see
|
|
<B><A HREF="/cgi-bin/man/man2html?7+feature_test_macros">feature_test_macros</A></B>(7)):
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>sigemptyset</B>(),
|
|
|
|
<B>sigfillset</B>(),
|
|
|
|
<B>sigaddset</B>(),
|
|
|
|
<B>sigdelset</B>(),
|
|
|
|
<B>sigismember</B>():
|
|
|
|
<DL COMPACT><DT id="1"><DD>
|
|
_POSIX_C_SOURCE
|
|
</DL>
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
These functions allow the manipulation of POSIX signal sets.
|
|
<P>
|
|
|
|
<B>sigemptyset</B>()
|
|
|
|
initializes the signal set given by
|
|
<I>set</I>
|
|
|
|
to empty, with all signals excluded from the set.
|
|
<P>
|
|
|
|
<B>sigfillset</B>()
|
|
|
|
initializes
|
|
<I>set</I>
|
|
|
|
to full, including all signals.
|
|
<P>
|
|
|
|
<B>sigaddset</B>()
|
|
|
|
and
|
|
<B>sigdelset</B>()
|
|
|
|
add and delete respectively signal
|
|
<I>signum</I>
|
|
|
|
from
|
|
<I>set</I>.
|
|
|
|
<P>
|
|
|
|
<B>sigismember</B>()
|
|
|
|
tests whether
|
|
<I>signum</I>
|
|
|
|
is a member of
|
|
<I>set</I>.
|
|
|
|
<P>
|
|
|
|
Objects of type
|
|
<I>sigset_t</I>
|
|
|
|
must be initialized by a call to either
|
|
<B>sigemptyset</B>()
|
|
|
|
or
|
|
<B>sigfillset</B>()
|
|
|
|
before being passed to the functions
|
|
<B>sigaddset</B>(),
|
|
|
|
<B>sigdelset</B>()
|
|
|
|
and
|
|
<B>sigismember</B>()
|
|
|
|
or the additional glibc functions described below
|
|
(<B>sigisemptyset</B>(),
|
|
|
|
<B>sigandset</B>(),
|
|
|
|
and
|
|
<B>sigorset</B>()).
|
|
|
|
The results are undefined if this is not done.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
<B>sigemptyset</B>(),
|
|
|
|
<B>sigfillset</B>(),
|
|
|
|
<B>sigaddset</B>(),
|
|
|
|
and
|
|
<B>sigdelset</B>()
|
|
|
|
return 0 on success and -1 on error.
|
|
<P>
|
|
|
|
<B>sigismember</B>()
|
|
|
|
returns 1 if
|
|
<I>signum</I>
|
|
|
|
is a member of
|
|
<I>set</I>,
|
|
|
|
0 if
|
|
<I>signum</I>
|
|
|
|
is not a member, and -1 on error.
|
|
<P>
|
|
|
|
On error, these functions set
|
|
<I>errno</I>
|
|
|
|
to indicate the cause of the error.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>ERRORS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="2"><B>EINVAL</B>
|
|
|
|
<DD>
|
|
<I>signum</I>
|
|
|
|
is not a valid signal.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>ATTRIBUTES</H2>
|
|
|
|
For an explanation of the terms used in this section, see
|
|
<B><A HREF="/cgi-bin/man/man2html?7+attributes">attributes</A></B>(7).
|
|
|
|
<TABLE BORDER>
|
|
<TR VALIGN=top><TD><B>Interface</B></TD><TD><B>Attribute</B></TD><TD><B>Value</B><BR></TD></TR>
|
|
<TR VALIGN=top><TD>
|
|
<B>sigemptyset</B>(),
|
|
|
|
<B>sigfillset</B>(),
|
|
|
|
<BR>
|
|
|
|
<B>sigaddset</B>(),
|
|
|
|
<B>sigdelset</B>(),
|
|
|
|
<BR>
|
|
|
|
<B>sigismember</B>(),
|
|
|
|
<B>sigisemptyset</B>(),
|
|
|
|
<BR>
|
|
|
|
<B>sigorset</B>(),
|
|
|
|
<B>sigandset</B>()
|
|
|
|
</TD><TD>Thread safety</TD><TD>MT-Safe<BR></TD></TR>
|
|
</TABLE>
|
|
|
|
<A NAME="lbAH"> </A>
|
|
<H2>CONFORMING TO</H2>
|
|
|
|
POSIX.1-2001, POSIX.1-2008.
|
|
<A NAME="lbAI"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
When creating a filled signal set, the glibc
|
|
<B>sigfillset</B>()
|
|
|
|
function does not include the two real-time signals used internally
|
|
by the NPTL threading implementation.
|
|
See
|
|
<B><A HREF="/cgi-bin/man/man2html?7+nptl">nptl</A></B>(7)
|
|
|
|
for details.
|
|
|
|
<A NAME="lbAJ"> </A>
|
|
<H3>Glibc extensions</H3>
|
|
|
|
If the
|
|
<B>_GNU_SOURCE</B>
|
|
|
|
feature test macro is defined, then <I><<A HREF="file:///usr/include/signal.h">signal.h</A>></I>
|
|
exposes three other functions for manipulating signal
|
|
sets:
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>int sigisemptyset(const sigset_t *</B><I>set</I><B>);</B>
|
|
<B>int sigorset(sigset_t *</B><I>dest</I><B>, const sigset_t *</B><I>left</I><B>,</B>
|
|
<B> const sigset_t *</B><I>right</I><B>);</B>
|
|
<B>int sigandset(sigset_t *</B><I>dest</I><B>, const sigset_t *</B><I>left</I><B>,</B>
|
|
<B> const sigset_t *</B><I>right</I><B>);</B>
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
<B>sigisemptyset</B>()
|
|
|
|
returns 1 if
|
|
<I>set</I>
|
|
|
|
contains no signals, and 0 otherwise.
|
|
<P>
|
|
|
|
<B>sigorset</B>()
|
|
|
|
places the union of the sets
|
|
<I>left</I>
|
|
|
|
and
|
|
<I>right</I>
|
|
|
|
in
|
|
<I>dest</I>.
|
|
|
|
<B>sigandset</B>()
|
|
|
|
places the intersection of the sets
|
|
<I>left</I>
|
|
|
|
and
|
|
<I>right</I>
|
|
|
|
in
|
|
<I>dest</I>.
|
|
|
|
Both functions return 0 on success, and -1 on failure.
|
|
<P>
|
|
|
|
These functions are nonstandard (a few other systems provide similar
|
|
functions) and their use should be avoided in portable applications.
|
|
<A NAME="lbAK"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sigaction">sigaction</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sigpending">sigpending</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sigprocmask">sigprocmask</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sigsuspend">sigsuspend</A></B>(2)
|
|
|
|
<A NAME="lbAL"> </A>
|
|
<H2>COLOPHON</H2>
|
|
|
|
This page is part of release 5.05 of the Linux
|
|
<I>man-pages</I>
|
|
|
|
project.
|
|
A description of the project,
|
|
information about reporting bugs,
|
|
and the latest version of this page,
|
|
can be found at
|
|
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="3"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="4"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="5"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="6"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DT id="7"><A HREF="#lbAF">ERRORS</A><DD>
|
|
<DT id="8"><A HREF="#lbAG">ATTRIBUTES</A><DD>
|
|
<DT id="9"><A HREF="#lbAH">CONFORMING TO</A><DD>
|
|
<DT id="10"><A HREF="#lbAI">NOTES</A><DD>
|
|
<DL>
|
|
<DT id="11"><A HREF="#lbAJ">Glibc extensions</A><DD>
|
|
</DL>
|
|
<DT id="12"><A HREF="#lbAK">SEE ALSO</A><DD>
|
|
<DT id="13"><A HREF="#lbAL">COLOPHON</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:56 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|