]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/gsignal.3
Many pages: LIBRARY: srcfix
[thirdparty/man-pages.git] / man3 / gsignal.3
CommitLineData
fea681da
MK
1.\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl>
2.\"
5fbde956 3.\" SPDX-License-Identifier: Linux-man-pages-copyleft
fea681da
MK
4.\"
5.\" This replaces an earlier man page written by Walter Harms
6.\" <walter.harms@informatik.uni-oldenburg.de>.
1d767b55 7.TH GSIGNAL 3 2021-03-22 "" "Linux Programmer's Manual"
fea681da
MK
8.SH NAME
9gsignal, ssignal \- software signal facility
4508f8a0
AC
10.SH LIBRARY
11Standard C library
8fc3b2cf 12.RI ( libc ", " \-lc )
fea681da
MK
13.SH SYNOPSIS
14.nf
15.B #include <signal.h>
68e4db0a 16.PP
fea681da 17.B typedef void (*sighandler_t)(int);
68e4db0a 18.PP
61474e1b 19.BI "int gsignal(int " signum );
68e4db0a 20.PP
fea681da 21.BI "sighandler_t ssignal(int " signum ", sighandler_t " action );
cc4615cc 22.fi
68e4db0a 23.PP
d39ad78f 24.RS -4
cc4615cc
MK
25Feature Test Macro Requirements for glibc (see
26.BR feature_test_macros (7)):
d39ad78f 27.RE
68e4db0a 28.PP
cc4615cc
MK
29.BR gsignal (),
30.BR ssignal ():
9d281e06 31.nf
51c612fb
MK
32 Since glibc 2.19:
33 _DEFAULT_SOURCE
34 Glibc 2.19 and earlier:
35 _SVID_SOURCE
9d281e06 36.fi
fea681da
MK
37.SH DESCRIPTION
38Don't use these functions under Linux.
39Due to a historical mistake, under Linux these functions are
40aliases for
fb186734 41.BR raise (3)
fea681da 42and
fb186734 43.BR signal (2),
fea681da 44respectively.
dd3568a1 45.PP
80b50848 46Elsewhere, on System V-like systems, these functions implement
d9bfdb9c 47software signaling, entirely independent of the classical
d9a10d9d
MK
48.BR signal (2)
49and
50.BR kill (2)
51functions.
c13182ef 52The function
63aa9df0 53.BR ssignal ()
fea681da
MK
54defines the action to take when the software signal with
55number
56.I signum
57is raised using the function
63aa9df0 58.BR gsignal (),
8bd58774
MK
59and returns the previous such action or
60.BR SIG_DFL .
fea681da 61The function
63aa9df0 62.BR gsignal ()
8bd58774
MK
63does the following: if no action (or the action
64.BR SIG_DFL )
65was
fea681da
MK
66specified for
67.IR signum ,
68then it does nothing and returns 0.
8bd58774 69If the action
0daa9e92 70.B SIG_IGN
8bd58774 71was specified for
fea681da
MK
72.IR signum ,
73then it does nothing and returns 1.
8bd58774 74Otherwise, it resets the action to
0daa9e92 75.B SIG_DFL
8bd58774 76and calls
c4bb193f 77the action function with argument
fea681da
MK
78.IR signum ,
79and returns the value returned by that function.
80The range of possible values
81.I signum
9bc87ed0 82varies (often 1\(en15 or 1\(en17).
af642253
ZL
83.SH ATTRIBUTES
84For an explanation of the terms used in this section, see
85.BR attributes (7).
c466875e
MK
86.ad l
87.nh
af642253
ZL
88.TS
89allbox;
c466875e 90lbx lb lb
af642253
ZL
91l l l.
92Interface Attribute Value
93T{
94.BR gsignal ()
95T} Thread safety MT-Safe
96T{
97.BR ssignal ()
98T} Thread safety MT-Safe sigintr
99.TE
c466875e
MK
100.hy
101.ad
847e0d88 102.sp 1
47297adb 103.SH CONFORMING TO
68e1685c 104These functions are available under AIX, DG/UX, HP-UX, SCO, Solaris, Tru64.
fea681da 105They are called obsolete under most of these systems, and are
50fd1cfe
MK
106broken under
107.\" Linux libc and
108glibc.
fea681da 109Some systems also have
31e9a9ec 110.BR gsignal_r ()
fea681da 111and
31e9a9ec 112.BR ssignal_r ().
47297adb 113.SH SEE ALSO
fea681da
MK
114.BR kill (2),
115.BR signal (2),
116.BR raise (3)