]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/gsignal.3
dlopen.3: tfix
[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>.
e8426ca2 27.TH GSIGNAL 3 2020-04-11 "" "Linux Programmer's Manual"
fea681da
MK
28.SH NAME
29gsignal, ssignal \- software signal facility
30.SH SYNOPSIS
31.nf
32.B #include <signal.h>
68e4db0a 33.PP
fea681da 34.B typedef void (*sighandler_t)(int);
68e4db0a 35.PP
61474e1b 36.BI "int gsignal(int " signum );
68e4db0a 37.PP
fea681da 38.BI "sighandler_t ssignal(int " signum ", sighandler_t " action );
cc4615cc 39.fi
68e4db0a 40.PP
cc4615cc
MK
41.in -4n
42Feature Test Macro Requirements for glibc (see
43.BR feature_test_macros (7)):
44.in
68e4db0a 45.PP
cc4615cc
MK
46.BR gsignal (),
47.BR ssignal ():
51c612fb
MK
48 Since glibc 2.19:
49 _DEFAULT_SOURCE
50 Glibc 2.19 and earlier:
51 _SVID_SOURCE
fea681da
MK
52.SH DESCRIPTION
53Don't use these functions under Linux.
54Due to a historical mistake, under Linux these functions are
55aliases for
fb186734 56.BR raise (3)
fea681da 57and
fb186734 58.BR signal (2),
fea681da 59respectively.
dd3568a1 60.PP
80b50848 61Elsewhere, on System V-like systems, these functions implement
d9bfdb9c 62software signaling, entirely independent of the classical
d9a10d9d
MK
63.BR signal (2)
64and
65.BR kill (2)
66functions.
c13182ef 67The function
63aa9df0 68.BR ssignal ()
fea681da
MK
69defines the action to take when the software signal with
70number
71.I signum
72is raised using the function
63aa9df0 73.BR gsignal (),
8bd58774
MK
74and returns the previous such action or
75.BR SIG_DFL .
fea681da 76The function
63aa9df0 77.BR gsignal ()
8bd58774
MK
78does the following: if no action (or the action
79.BR SIG_DFL )
80was
fea681da
MK
81specified for
82.IR signum ,
83then it does nothing and returns 0.
8bd58774 84If the action
0daa9e92 85.B SIG_IGN
8bd58774 86was specified for
fea681da
MK
87.IR signum ,
88then it does nothing and returns 1.
8bd58774 89Otherwise, it resets the action to
0daa9e92 90.B SIG_DFL
8bd58774 91and calls
c4bb193f 92the action function with argument
fea681da
MK
93.IR signum ,
94and returns the value returned by that function.
95The range of possible values
96.I signum
9bc87ed0 97varies (often 1\(en15 or 1\(en17).
af642253
ZL
98.SH ATTRIBUTES
99For an explanation of the terms used in this section, see
100.BR attributes (7).
101.TS
102allbox;
103lb lb lb
104l l l.
105Interface Attribute Value
106T{
107.BR gsignal ()
108T} Thread safety MT-Safe
109T{
110.BR ssignal ()
111T} Thread safety MT-Safe sigintr
112.TE
847e0d88 113.sp 1
47297adb 114.SH CONFORMING TO
68e1685c 115These functions are available under AIX, DG/UX, HP-UX, SCO, Solaris, Tru64.
fea681da 116They are called obsolete under most of these systems, and are
50fd1cfe
MK
117broken under
118.\" Linux libc and
119glibc.
fea681da 120Some systems also have
31e9a9ec 121.BR gsignal_r ()
fea681da 122and
31e9a9ec 123.BR ssignal_r ().
47297adb 124.SH SEE ALSO
fea681da
MK
125.BR kill (2),
126.BR signal (2),
127.BR raise (3)