OSDN Git Service

(split) LDP: Update original to LDP v3.40.
[linuxjm/LDP_man-pages.git] / original / man3 / gsignal.3
1 .\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" This replaces an earlier man page written by Walter Harms
24 .\" <walter.harms@informatik.uni-oldenburg.de>.
25 .TH GSIGNAL 3  2007-07-26 "" "Linux Programmer's Manual"
26 .SH NAME
27 gsignal, ssignal \- software signal facility
28 .SH SYNOPSIS
29 .nf
30 .B #include <signal.h>
31 .sp
32 .B typedef void (*sighandler_t)(int);
33 .sp
34 .BI "int gsignal(int " signum );
35 .sp
36 .BI "sighandler_t ssignal(int " signum ", sighandler_t " action );
37 .fi
38 .sp
39 .in -4n
40 Feature Test Macro Requirements for glibc (see
41 .BR feature_test_macros (7)):
42 .in
43 .sp
44 .BR gsignal (),
45 .BR ssignal ():
46 _SVID_SOURCE
47 .SH DESCRIPTION
48 Don't use these functions under Linux.
49 Due to a historical mistake, under Linux these functions are
50 aliases for
51 .BR raise (3)
52 and
53 .BR signal (2),
54 respectively.
55 .LP
56 Elsewhere, on System V-like systems, these functions implement
57 software signaling, entirely independent of the classical
58 .BR signal (2)
59 and
60 .BR kill (2)
61 functions.
62 The function
63 .BR ssignal ()
64 defines the action to take when the software signal with
65 number
66 .I signum
67 is raised using the function
68 .BR gsignal (),
69 and returns the previous such action or
70 .BR SIG_DFL .
71 The function
72 .BR gsignal ()
73 does the following: if no action (or the action
74 .BR SIG_DFL )
75 was
76 specified for
77 .IR signum ,
78 then it does nothing and returns 0.
79 If the action
80 .B SIG_IGN
81 was specified for
82 .IR signum ,
83 then it does nothing and returns 1.
84 Otherwise, it resets the action to
85 .B SIG_DFL
86 and calls
87 the action function with argument
88 .IR signum ,
89 and returns the value returned by that function.
90 The range of possible values
91 .I signum
92 varies (often 1-15 or 1-17).
93 .SH "CONFORMING TO"
94 These functions are available under AIX, DG/UX, HP-UX, SCO, Solaris, Tru64.
95 They are called obsolete under most of these systems, and are
96 broken under Linux libc and glibc.
97 Some systems also have
98 .BR gsignal_r ()
99 and
100 .BR ssignal_r ().
101 .SH "SEE ALSO"
102 .BR kill (2),
103 .BR signal (2),
104 .BR raise (3)