]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/gsignal.3
setjmp.3: Remove reference to obsolete _XOPEN_SOURCE_EXTENDED
[thirdparty/man-pages.git] / man3 / gsignal.3
CommitLineData
fea681da
MK
1.\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl>
2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
7.\"
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
c13182ef 12.\"
fea681da
MK
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date. The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
16.\" the use of the information contained herein. The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
c13182ef 20.\"
fea681da
MK
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 23.\" %%%LICENSE_END
fea681da
MK
24.\"
25.\" This replaces an earlier man page written by Walter Harms
26.\" <walter.harms@informatik.uni-oldenburg.de>.
5722c835 27.TH GSIGNAL 3 2015-07-23 "" "Linux Programmer's Manual"
fea681da
MK
28.SH NAME
29gsignal, ssignal \- software signal facility
30.SH SYNOPSIS
31.nf
32.B #include <signal.h>
33.sp
34.B typedef void (*sighandler_t)(int);
35.sp
61474e1b 36.BI "int gsignal(int " signum );
fea681da
MK
37.sp
38.BI "sighandler_t ssignal(int " signum ", sighandler_t " action );
cc4615cc
MK
39.fi
40.sp
41.in -4n
42Feature Test Macro Requirements for glibc (see
43.BR feature_test_macros (7)):
44.in
45.sp
46.BR gsignal (),
47.BR ssignal ():
48_SVID_SOURCE
fea681da
MK
49.SH DESCRIPTION
50Don't use these functions under Linux.
51Due to a historical mistake, under Linux these functions are
52aliases for
fb186734 53.BR raise (3)
fea681da 54and
fb186734 55.BR signal (2),
fea681da
MK
56respectively.
57.LP
80b50848 58Elsewhere, on System V-like systems, these functions implement
d9bfdb9c 59software signaling, entirely independent of the classical
d9a10d9d
MK
60.BR signal (2)
61and
62.BR kill (2)
63functions.
c13182ef 64The function
63aa9df0 65.BR ssignal ()
fea681da
MK
66defines the action to take when the software signal with
67number
68.I signum
69is raised using the function
63aa9df0 70.BR gsignal (),
8bd58774
MK
71and returns the previous such action or
72.BR SIG_DFL .
fea681da 73The function
63aa9df0 74.BR gsignal ()
8bd58774
MK
75does the following: if no action (or the action
76.BR SIG_DFL )
77was
fea681da
MK
78specified for
79.IR signum ,
80then it does nothing and returns 0.
8bd58774 81If the action
0daa9e92 82.B SIG_IGN
8bd58774 83was specified for
fea681da
MK
84.IR signum ,
85then it does nothing and returns 1.
8bd58774 86Otherwise, it resets the action to
0daa9e92 87.B SIG_DFL
8bd58774 88and calls
c4bb193f 89the action function with argument
fea681da
MK
90.IR signum ,
91and returns the value returned by that function.
92The range of possible values
93.I signum
94varies (often 1-15 or 1-17).
af642253
ZL
95.SH ATTRIBUTES
96For an explanation of the terms used in this section, see
97.BR attributes (7).
98.TS
99allbox;
100lb lb lb
101l l l.
102Interface Attribute Value
103T{
104.BR gsignal ()
105T} Thread safety MT-Safe
106T{
107.BR ssignal ()
108T} Thread safety MT-Safe sigintr
109.TE
110
47297adb 111.SH CONFORMING TO
68e1685c 112These functions are available under AIX, DG/UX, HP-UX, SCO, Solaris, Tru64.
fea681da
MK
113They are called obsolete under most of these systems, and are
114broken under Linux libc and glibc.
115Some systems also have
31e9a9ec 116.BR gsignal_r ()
fea681da 117and
31e9a9ec 118.BR ssignal_r ().
47297adb 119.SH SEE ALSO
fea681da
MK
120.BR kill (2),
121.BR signal (2),
122.BR raise (3)