1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
'\" t
.\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl>
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
.\" This replaces an earlier man page written by Walter Harms
.\" <walter.harms@informatik.uni-oldenburg.de>.
.TH gsignal 3 2024-05-02 "Linux man-pages (unreleased)"
.SH NAME
gsignal, ssignal \- software signal facility
.SH LIBRARY
Standard C library
.RI ( libc ", " \-lc )
.SH SYNOPSIS
.nf
.B #include <signal.h>
.P
.B typedef void (*sighandler_t)(int);
.P
.BI "[[deprecated]] int gsignal(int " signum );
.P
.BI "[[deprecated]] sighandler_t ssignal(int " signum ", sighandler_t " action );
.fi
.P
.RS -4
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.RE
.P
.BR gsignal (),
.BR ssignal ():
.nf
Since glibc 2.19:
_DEFAULT_SOURCE
glibc 2.19 and earlier:
_SVID_SOURCE
.fi
.SH DESCRIPTION
Don't use these functions under Linux.
Due to a historical mistake, under Linux these functions are
aliases for
.BR raise (3)
and
.BR signal (2),
respectively.
.P
Elsewhere, on System V-like systems, these functions implement
software signaling, entirely independent of the classical
.BR signal (2)
and
.BR kill (2)
functions.
The function
.BR ssignal ()
defines the action to take when the software signal with
number
.I signum
is raised using the function
.BR gsignal (),
and returns the previous such action or
.BR SIG_DFL .
The function
.BR gsignal ()
does the following: if no action (or the action
.BR SIG_DFL )
was
specified for
.IR signum ,
then it does nothing and returns 0.
If the action
.B SIG_IGN
was specified for
.IR signum ,
then it does nothing and returns 1.
Otherwise, it resets the action to
.B SIG_DFL
and calls
the action function with argument
.IR signum ,
and returns the value returned by that function.
The range of possible values
.I signum
varies (often 1\[en]15 or 1\[en]17).
.SH ATTRIBUTES
For an explanation of the terms used in this section, see
.BR attributes (7).
.TS
allbox;
lbx lb lb
l l l.
Interface Attribute Value
T{
.na
.nh
.BR gsignal ()
T} Thread safety MT-Safe
T{
.na
.nh
.BR ssignal ()
T} Thread safety MT-Safe sigintr
.TE
.SH STANDARDS
None.
.SH HISTORY
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
.BR gsignal_r ()
and
.BR ssignal_r ().
.SH SEE ALSO
.BR kill (2),
.BR signal (2),
.BR raise (3)
|