]>
Commit | Line | Data |
---|---|---|
1 | .\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl> | |
2 | .\" | |
3 | .\" %%%LICENSE_START(VERBATIM) | |
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. | |
12 | .\" | |
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. | |
20 | .\" | |
21 | .\" Formatted or processed versions of this manual, if unaccompanied by | |
22 | .\" the source, must acknowledge the copyright and authors of this work. | |
23 | .\" %%%LICENSE_END | |
24 | .\" | |
25 | .\" This replaces an earlier man page written by Walter Harms | |
26 | .\" <walter.harms@informatik.uni-oldenburg.de>. | |
27 | .TH GSIGNAL 3 2020-04-11 "" "Linux Programmer's Manual" | |
28 | .SH NAME | |
29 | gsignal, ssignal \- software signal facility | |
30 | .SH SYNOPSIS | |
31 | .nf | |
32 | .B #include <signal.h> | |
33 | .PP | |
34 | .B typedef void (*sighandler_t)(int); | |
35 | .PP | |
36 | .BI "int gsignal(int " signum ); | |
37 | .PP | |
38 | .BI "sighandler_t ssignal(int " signum ", sighandler_t " action ); | |
39 | .fi | |
40 | .PP | |
41 | .in -4n | |
42 | Feature Test Macro Requirements for glibc (see | |
43 | .BR feature_test_macros (7)): | |
44 | .in | |
45 | .PP | |
46 | .BR gsignal (), | |
47 | .BR ssignal (): | |
48 | Since glibc 2.19: | |
49 | _DEFAULT_SOURCE | |
50 | Glibc 2.19 and earlier: | |
51 | _SVID_SOURCE | |
52 | .SH DESCRIPTION | |
53 | Don't use these functions under Linux. | |
54 | Due to a historical mistake, under Linux these functions are | |
55 | aliases for | |
56 | .BR raise (3) | |
57 | and | |
58 | .BR signal (2), | |
59 | respectively. | |
60 | .PP | |
61 | Elsewhere, on System V-like systems, these functions implement | |
62 | software signaling, entirely independent of the classical | |
63 | .BR signal (2) | |
64 | and | |
65 | .BR kill (2) | |
66 | functions. | |
67 | The function | |
68 | .BR ssignal () | |
69 | defines the action to take when the software signal with | |
70 | number | |
71 | .I signum | |
72 | is raised using the function | |
73 | .BR gsignal (), | |
74 | and returns the previous such action or | |
75 | .BR SIG_DFL . | |
76 | The function | |
77 | .BR gsignal () | |
78 | does the following: if no action (or the action | |
79 | .BR SIG_DFL ) | |
80 | was | |
81 | specified for | |
82 | .IR signum , | |
83 | then it does nothing and returns 0. | |
84 | If the action | |
85 | .B SIG_IGN | |
86 | was specified for | |
87 | .IR signum , | |
88 | then it does nothing and returns 1. | |
89 | Otherwise, it resets the action to | |
90 | .B SIG_DFL | |
91 | and calls | |
92 | the action function with argument | |
93 | .IR signum , | |
94 | and returns the value returned by that function. | |
95 | The range of possible values | |
96 | .I signum | |
97 | varies (often 1\(en15 or 1\(en17). | |
98 | .SH ATTRIBUTES | |
99 | For an explanation of the terms used in this section, see | |
100 | .BR attributes (7). | |
101 | .TS | |
102 | allbox; | |
103 | lb lb lb | |
104 | l l l. | |
105 | Interface Attribute Value | |
106 | T{ | |
107 | .BR gsignal () | |
108 | T} Thread safety MT-Safe | |
109 | T{ | |
110 | .BR ssignal () | |
111 | T} Thread safety MT-Safe sigintr | |
112 | .TE | |
113 | .sp 1 | |
114 | .SH CONFORMING TO | |
115 | These functions are available under AIX, DG/UX, HP-UX, SCO, Solaris, Tru64. | |
116 | They are called obsolete under most of these systems, and are | |
117 | broken under | |
118 | .\" Linux libc and | |
119 | glibc. | |
120 | Some systems also have | |
121 | .BR gsignal_r () | |
122 | and | |
123 | .BR ssignal_r (). | |
124 | .SH SEE ALSO | |
125 | .BR kill (2), | |
126 | .BR signal (2), | |
127 | .BR raise (3) |