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