2004-11-03 13:51:07 +00:00
|
|
|
.\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl>
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
|
|
.\"
|
|
|
|
.\" This replaces an earlier man page written by Walter Harms
|
|
|
|
.\" <walter.harms@informatik.uni-oldenburg.de>.
|
2007-07-08 12:11:40 +00:00
|
|
|
.TH GSIGNAL 3 2007-07-26 "" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
|
|
|
gsignal, ssignal \- software signal facility
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B #include <signal.h>
|
|
|
|
.sp
|
|
|
|
.B typedef void (*sighandler_t)(int);
|
|
|
|
.sp
|
2007-07-13 08:13:38 +00:00
|
|
|
.BI "int gsignal(int" signum );
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
|
|
|
.BI "sighandler_t ssignal(int " signum ", sighandler_t " action );
|
2007-07-08 12:11:40 +00:00
|
|
|
.fi
|
|
|
|
.sp
|
|
|
|
.in -4n
|
|
|
|
Feature Test Macro Requirements for glibc (see
|
|
|
|
.BR feature_test_macros (7)):
|
|
|
|
.in
|
|
|
|
.sp
|
|
|
|
.BR gsignal (),
|
|
|
|
.BR ssignal ():
|
|
|
|
_SVID_SOURCE
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH DESCRIPTION
|
|
|
|
Don't use these functions under Linux.
|
|
|
|
Due to a historical mistake, under Linux these functions are
|
|
|
|
aliases for
|
2007-05-12 00:30:29 +00:00
|
|
|
.BR raise (3)
|
2004-11-03 13:51:07 +00:00
|
|
|
and
|
2007-05-12 00:30:29 +00:00
|
|
|
.BR signal (2),
|
2004-11-03 13:51:07 +00:00
|
|
|
respectively.
|
|
|
|
.LP
|
2006-01-13 09:44:53 +00:00
|
|
|
Elsewhere, on System V-like systems, these functions implement
|
2007-06-08 09:56:56 +00:00
|
|
|
software signaling, entirely independent of the classical
|
2007-12-13 20:46:52 +00:00
|
|
|
.BR signal (2)
|
|
|
|
and
|
|
|
|
.BR kill (2)
|
|
|
|
functions.
|
2007-04-12 22:42:49 +00:00
|
|
|
The function
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR ssignal ()
|
2004-11-03 13:51:07 +00:00
|
|
|
defines the action to take when the software signal with
|
|
|
|
number
|
|
|
|
.I signum
|
|
|
|
is raised using the function
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR gsignal (),
|
2007-06-21 05:38:48 +00:00
|
|
|
and returns the previous such action or
|
|
|
|
.BR SIG_DFL .
|
2004-11-03 13:51:07 +00:00
|
|
|
The function
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR gsignal ()
|
2007-06-21 05:38:48 +00:00
|
|
|
does the following: if no action (or the action
|
|
|
|
.BR SIG_DFL )
|
|
|
|
was
|
2004-11-03 13:51:07 +00:00
|
|
|
specified for
|
|
|
|
.IR signum ,
|
|
|
|
then it does nothing and returns 0.
|
2007-06-21 05:38:48 +00:00
|
|
|
If the action
|
2007-09-20 16:26:31 +00:00
|
|
|
.B SIG_IGN
|
2007-06-21 05:38:48 +00:00
|
|
|
was specified for
|
2004-11-03 13:51:07 +00:00
|
|
|
.IR signum ,
|
|
|
|
then it does nothing and returns 1.
|
2007-06-21 05:38:48 +00:00
|
|
|
Otherwise, it resets the action to
|
2007-09-20 16:26:31 +00:00
|
|
|
.B SIG_DFL
|
2007-06-21 05:38:48 +00:00
|
|
|
and calls
|
2008-07-10 20:53:08 +00:00
|
|
|
the action function with argument
|
2004-11-03 13:51:07 +00:00
|
|
|
.IR signum ,
|
|
|
|
and returns the value returned by that function.
|
|
|
|
The range of possible values
|
|
|
|
.I signum
|
|
|
|
varies (often 1-15 or 1-17).
|
|
|
|
.SH "CONFORMING TO"
|
2006-08-03 13:57:30 +00:00
|
|
|
These functions are available under AIX, DG/UX, HP-UX, SCO, Solaris, Tru64.
|
2004-11-03 13:51:07 +00:00
|
|
|
They are called obsolete under most of these systems, and are
|
|
|
|
broken under Linux libc and glibc.
|
|
|
|
Some systems also have
|
2005-11-02 11:34:24 +00:00
|
|
|
.BR gsignal_r ()
|
2004-11-03 13:51:07 +00:00
|
|
|
and
|
2005-11-02 11:34:24 +00:00
|
|
|
.BR ssignal_r ().
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR kill (2),
|
|
|
|
.BR signal (2),
|
|
|
|
.BR raise (3)
|