196 lines
4.4 KiB
HTML
196 lines
4.4 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SIGWAIT</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SIGWAIT</H1>
|
|
Section: Linux Programmer's Manual (3)<BR>Updated: 2017-07-13<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>
|
|
|
|
sigwait - wait for a signal
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<PRE>
|
|
<B>#include <<A HREF="file:///usr/include/signal.h">signal.h</A>></B>
|
|
|
|
<B> int sigwait(const sigset_t *</B><I>set</I><B>, int *</B><I>sig</I><B>);</B>
|
|
</PRE>
|
|
|
|
<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>sigwait</B>():
|
|
|
|
<DL COMPACT><DT id="1"><DD>
|
|
Since glibc 2.26:
|
|
<BR> _POSIX_C_SOURCE >= 199506L
|
|
<BR>
|
|
|
|
Glibc 2.25 and earlier:
|
|
<BR> _POSIX_C_SOURCE
|
|
</DL>
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The
|
|
<B>sigwait</B>()
|
|
|
|
function suspends execution of the calling thread until
|
|
one of the signals specified in the signal set
|
|
<I>set</I>
|
|
|
|
becomes pending.
|
|
The function accepts the signal
|
|
(removes it from the pending list of signals),
|
|
and returns the signal number in
|
|
<I>sig</I>.
|
|
|
|
<P>
|
|
|
|
The operation of
|
|
<B>sigwait</B>()
|
|
|
|
is the same as
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sigwaitinfo">sigwaitinfo</A></B>(2),
|
|
|
|
except that:
|
|
<DL COMPACT>
|
|
<DT id="2">*<DD>
|
|
<B>sigwait</B>()
|
|
|
|
returns only the signal number, rather than a
|
|
<I>siginfo_t</I>
|
|
|
|
structure describing the signal.
|
|
<DT id="3">*<DD>
|
|
The return values of the two functions are different.
|
|
</DL>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
On success,
|
|
<B>sigwait</B>()
|
|
|
|
returns 0.
|
|
On error, it returns a positive error number (listed in ERRORS).
|
|
<A NAME="lbAF"> </A>
|
|
<H2>ERRORS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="4"><B>EINVAL</B>
|
|
|
|
<DD>
|
|
|
|
<I>set</I>
|
|
|
|
contains an invalid signal number.
|
|
</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>sigwait</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>
|
|
|
|
<B>sigwait</B>()
|
|
|
|
is implemented using
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sigtimedwait">sigtimedwait</A></B>(2).
|
|
|
|
<P>
|
|
|
|
The glibc implementation of
|
|
<B>sigwait</B>()
|
|
|
|
silently ignores attempts to wait for the two real-time signals that
|
|
are 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>
|
|
<H2>EXAMPLE</H2>
|
|
|
|
See
|
|
<B><A HREF="/cgi-bin/man/man2html?3+pthread_sigmask">pthread_sigmask</A></B>(3).
|
|
|
|
<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+signalfd">signalfd</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sigpending">sigpending</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sigsuspend">sigsuspend</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sigwaitinfo">sigwaitinfo</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sigsetops">sigsetops</A></B>(3),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?7+signal">signal</A></B>(7)
|
|
|
|
<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="5"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="6"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="7"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="8"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DT id="9"><A HREF="#lbAF">ERRORS</A><DD>
|
|
<DT id="10"><A HREF="#lbAG">ATTRIBUTES</A><DD>
|
|
<DT id="11"><A HREF="#lbAH">CONFORMING TO</A><DD>
|
|
<DT id="12"><A HREF="#lbAI">NOTES</A><DD>
|
|
<DT id="13"><A HREF="#lbAJ">EXAMPLE</A><DD>
|
|
<DT id="14"><A HREF="#lbAK">SEE ALSO</A><DD>
|
|
<DT id="15"><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>
|