OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man3 / gsignal.3
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  2007-07-26 "" "Linux Programmer's Manual"
28 .SH NAME
29 gsignal, ssignal \- software signal facility
30 .SH SYNOPSIS
31 .nf
32 .B #include <signal.h>
33 .sp
34 .B typedef void (*sighandler_t)(int);
35 .sp
36 .BI "int gsignal(int " signum );
37 .sp
38 .BI "sighandler_t ssignal(int " signum ", sighandler_t " action );
39 .fi
40 .sp
41 .in -4n
42 Feature Test Macro Requirements for glibc (see
43 .BR feature_test_macros (7)):
44 .in
45 .sp
46 .BR gsignal (),
47 .BR ssignal ():
48 _SVID_SOURCE
49 .SH DESCRIPTION
50 Don't use these functions under Linux.
51 Due to a historical mistake, under Linux these functions are
52 aliases for
53 .BR raise (3)
54 and
55 .BR signal (2),
56 respectively.
57 .LP
58 Elsewhere, on System V-like systems, these functions implement
59 software signaling, entirely independent of the classical
60 .BR signal (2)
61 and
62 .BR kill (2)
63 functions.
64 The function
65 .BR ssignal ()
66 defines the action to take when the software signal with
67 number
68 .I signum
69 is raised using the function
70 .BR gsignal (),
71 and returns the previous such action or
72 .BR SIG_DFL .
73 The function
74 .BR gsignal ()
75 does the following: if no action (or the action
76 .BR SIG_DFL )
77 was
78 specified for
79 .IR signum ,
80 then it does nothing and returns 0.
81 If the action
82 .B SIG_IGN
83 was specified for
84 .IR signum ,
85 then it does nothing and returns 1.
86 Otherwise, it resets the action to
87 .B SIG_DFL
88 and calls
89 the action function with argument
90 .IR signum ,
91 and returns the value returned by that function.
92 The range of possible values
93 .I signum
94 varies (often 1-15 or 1-17).
95 .SH CONFORMING TO
96 These functions are available under AIX, DG/UX, HP-UX, SCO, Solaris, Tru64.
97 They are called obsolete under most of these systems, and are
98 broken under Linux libc and glibc.
99 Some systems also have
100 .BR gsignal_r ()
101 and
102 .BR ssignal_r ().
103 .SH SEE ALSO
104 .BR kill (2),
105 .BR signal (2),
106 .BR raise (3)
107 .SH COLOPHON
108 This page is part of release 3.68 of the Linux
109 .I man-pages
110 project.
111 A description of the project,
112 information about reporting bugs,
113 and the latest version of this page,
114 can be found at
115 \%http://www.kernel.org/doc/man\-pages/.