180 lines
4.2 KiB
HTML
180 lines
4.2 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of GSIGNAL</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>GSIGNAL</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>
|
|
|
|
gsignal, ssignal - software signal facility
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<PRE>
|
|
<B>#include <<A HREF="file:///usr/include/signal.h">signal.h</A>></B>
|
|
|
|
<B>typedef void (*sighandler_t)(int);</B>
|
|
|
|
<B>int gsignal(int </B><I>signum</I><B>);</B>
|
|
|
|
<B>sighandler_t ssignal(int </B><I>signum</I><B>, sighandler_t </B><I>action</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>gsignal</B>(),
|
|
|
|
<B>ssignal</B>():
|
|
|
|
<BR> Since glibc 2.19:
|
|
<BR> _DEFAULT_SOURCE
|
|
<BR> Glibc 2.19 and earlier:
|
|
<BR> _SVID_SOURCE
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
Don't use these functions under Linux.
|
|
Due to a historical mistake, under Linux these functions are
|
|
aliases for
|
|
<B><A HREF="/cgi-bin/man/man2html?3+raise">raise</A></B>(3)
|
|
|
|
and
|
|
<B><A HREF="/cgi-bin/man/man2html?2+signal">signal</A></B>(2),
|
|
|
|
respectively.
|
|
<P>
|
|
|
|
Elsewhere, on System V-like systems, these functions implement
|
|
software signaling, entirely independent of the classical
|
|
<B><A HREF="/cgi-bin/man/man2html?2+signal">signal</A></B>(2)
|
|
|
|
and
|
|
<B><A HREF="/cgi-bin/man/man2html?2+kill">kill</A></B>(2)
|
|
|
|
functions.
|
|
The function
|
|
<B>ssignal</B>()
|
|
|
|
defines the action to take when the software signal with
|
|
number
|
|
<I>signum</I>
|
|
|
|
is raised using the function
|
|
<B>gsignal</B>(),
|
|
|
|
and returns the previous such action or
|
|
<B>SIG_DFL</B>.
|
|
|
|
The function
|
|
<B>gsignal</B>()
|
|
|
|
does the following: if no action (or the action
|
|
<B>SIG_DFL</B>)
|
|
|
|
was
|
|
specified for
|
|
<I>signum</I>,
|
|
|
|
then it does nothing and returns 0.
|
|
If the action
|
|
<B>SIG_IGN</B>
|
|
|
|
was specified for
|
|
<I>signum</I>,
|
|
|
|
then it does nothing and returns 1.
|
|
Otherwise, it resets the action to
|
|
<B>SIG_DFL</B>
|
|
|
|
and calls
|
|
the action function with argument
|
|
<I>signum</I>,
|
|
|
|
and returns the value returned by that function.
|
|
The range of possible values
|
|
<I>signum</I>
|
|
|
|
varies (often 1-15 or 1-17).
|
|
<A NAME="lbAE"> </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>gsignal</B>()
|
|
|
|
</TD><TD>Thread safety</TD><TD>MT-Safe<BR></TD></TR>
|
|
<TR VALIGN=top><TD>
|
|
<B>ssignal</B>()
|
|
|
|
</TD><TD>Thread safety</TD><TD>MT-Safe sigintr<BR></TD></TR>
|
|
</TABLE>
|
|
|
|
<P>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>CONFORMING TO</H2>
|
|
|
|
These functions are available under AIX, DG/UX, HP-UX, SCO, Solaris, Tru64.
|
|
They are called obsolete under most of these systems, and are
|
|
broken under Linux libc and glibc.
|
|
Some systems also have
|
|
<B>gsignal_r</B>()
|
|
|
|
and
|
|
<B>ssignal_r</B>().
|
|
|
|
<A NAME="lbAG"> </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+signal">signal</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?3+raise">raise</A></B>(3)
|
|
|
|
<A NAME="lbAH"> </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="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="4"><A HREF="#lbAE">ATTRIBUTES</A><DD>
|
|
<DT id="5"><A HREF="#lbAF">CONFORMING TO</A><DD>
|
|
<DT id="6"><A HREF="#lbAG">SEE ALSO</A><DD>
|
|
<DT id="7"><A HREF="#lbAH">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:45 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|