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