215 lines
4.9 KiB
HTML
215 lines
4.9 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SIGPAUSE</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SIGPAUSE</H1>
|
|
Section: Linux Programmer's Manual (3)<BR>Updated: 2017-09-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>
|
|
|
|
sigpause - atomically release blocked signals and wait for interrupt
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<PRE>
|
|
<B>#include <<A HREF="file:///usr/include/signal.h">signal.h</A>></B>
|
|
|
|
<B>int sigpause(int </B><I>sigmask</I><B>); /* BSD (but see NOTES) */</B>
|
|
|
|
<B>int sigpause(int </B><I>sig</I><B>); /* System V / UNIX 95 */</B>
|
|
</PRE>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
Don't use this function.
|
|
Use
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sigsuspend">sigsuspend</A></B>(2)
|
|
|
|
instead.
|
|
<P>
|
|
|
|
The function
|
|
<B>sigpause</B>()
|
|
|
|
is designed to wait for some signal.
|
|
It changes the process's signal mask (set of blocked signals),
|
|
and then waits for a signal to arrive.
|
|
Upon arrival of a signal, the original signal mask is restored.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
If
|
|
<B>sigpause</B>()
|
|
|
|
returns, it was interrupted by a signal and the return value is -1
|
|
with
|
|
<I>errno</I>
|
|
|
|
set to
|
|
<B>EINTR</B>.
|
|
|
|
<A NAME="lbAF"> </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>sigpause</B>()
|
|
|
|
</TD><TD>Thread safety</TD><TD>MT-Safe<BR></TD></TR>
|
|
</TABLE>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>CONFORMING TO</H2>
|
|
|
|
The System V version of
|
|
<B>sigpause</B>()
|
|
|
|
is standardized in POSIX.1-2001.
|
|
It is also specified in POSIX.1-2008, where it is marked obsolete.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
<A NAME="lbAI"> </A>
|
|
<H3>History</H3>
|
|
|
|
The classical BSD version of this function appeared in 4.2BSD.
|
|
It sets the process's signal mask to
|
|
<I>sigmask</I>.
|
|
|
|
UNIX 95 standardized the incompatible System V version of
|
|
this function, which removes only the specified signal
|
|
<I>sig</I>
|
|
|
|
from the process's signal mask.
|
|
|
|
The unfortunate situation with two incompatible functions with the
|
|
same name was solved by the
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sigsuspend">sigsuspend</A></B>(2)
|
|
|
|
function, that takes a
|
|
<I>sigset_t *</I>
|
|
|
|
argument (instead of an
|
|
<I>int</I>).
|
|
|
|
<A NAME="lbAJ"> </A>
|
|
<H3>Linux notes</H3>
|
|
|
|
On Linux, this routine is a system call only on the Sparc (sparc64)
|
|
architecture.
|
|
<P>
|
|
|
|
|
|
|
|
Glibc uses the BSD version if the
|
|
<B>_BSD_SOURCE</B>
|
|
|
|
feature test macro is defined and none of
|
|
<B>_POSIX_SOURCE</B>,
|
|
|
|
<B>_POSIX_C_SOURCE</B>,
|
|
|
|
<B>_XOPEN_SOURCE</B>,
|
|
|
|
<B>_GNU_SOURCE</B>,
|
|
|
|
or
|
|
<B>_SVID_SOURCE</B>
|
|
|
|
is defined.
|
|
Otherwise, the System V version is used,
|
|
and feature test macros must be defined as follows to obtain the declaration:
|
|
<DL COMPACT>
|
|
<DT id="1">*<DD>
|
|
Since glibc 2.26:
|
|
_XOPEN_SOURCE >= 500
|
|
|
|
<DT id="2">*<DD>
|
|
Glibc 2.25 and earlier: _XOPEN_SOURCE
|
|
</DL>
|
|
<P>
|
|
|
|
Since glibc 2.19, only the System V version is exposed by
|
|
<I><<A HREF="file:///usr/include/signal.h">signal.h</A>></I>;
|
|
|
|
applications that formerly used the BSD
|
|
<B>sigpause</B>()
|
|
|
|
should be amended to use
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sigsuspend">sigsuspend</A></B>(2).
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAK"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+kill">kill</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sigaction">sigaction</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),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sigblock">sigblock</A></B>(3),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sigvec">sigvec</A></B>(3),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?7+feature_test_macros">feature_test_macros</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="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">ATTRIBUTES</A><DD>
|
|
<DT id="8"><A HREF="#lbAG">CONFORMING TO</A><DD>
|
|
<DT id="9"><A HREF="#lbAH">NOTES</A><DD>
|
|
<DL>
|
|
<DT id="10"><A HREF="#lbAI">History</A><DD>
|
|
<DT id="11"><A HREF="#lbAJ">Linux notes</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>
|