OSDN Git Service

2c2176c6b9310dea137a957d1f14b3bf4fc19dec
[linuxjm/LDP_man-pages.git] / draft / 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 .\"
26 .\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI, all rights reserved.
27 .\" Translated Mon Feb  2 2003 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
28 .\"
29 .\"WORD:        broken          正しく実装されていない
30 .\"
31 .TH GSIGNAL 3  2007-07-26 "" "Linux Programmer's Manual"
32 .\"O .SH NAME
33 .\"O gsignal, ssignal \- software signal facility
34 .SH 名前
35 gsignal, ssignal \- ソフトウェア・シグナル機能
36 .\"O .SH SYNOPSIS
37 .SH 書式
38 .nf
39 .B #include <signal.h>
40 .sp
41 .B typedef void (*sighandler_t)(int);
42 .sp
43 .BI "int gsignal(int " signum );
44 .sp
45 .BI "sighandler_t ssignal(int " signum ", sighandler_t " action );
46 .fi
47 .sp
48 .in -4n
49 .\"O Feature Test Macro Requirements for glibc (see
50 .\"O .BR feature_test_macros (7)):
51 glibc 向けの機能検査マクロの要件
52 .RB ( feature_test_macros (7)
53 参照):
54 .in
55 .sp
56 .BR gsignal (),
57 .BR ssignal ():
58 _SVID_SOURCE
59 .\"O .SH DESCRIPTION
60 .SH 説明
61 .\"O Don't use these functions under Linux.
62 Linux ではこれらの関数を使用しないこと。
63 .\"O Due to a historical mistake, under Linux these functions are
64 .\"O aliases for
65 .\"O .BR raise (3)
66 .\"O and
67 .\"O .BR signal (2),
68 .\"O respectively.
69 過去に間違いがあり、Linux では
70 .BR gsignal ()
71
72 .BR ssignal ()
73 はそれぞれ
74 .BR raise (3)
75
76 .BR signal (2)
77 の別名になっている。
78 .LP
79 .\"O Elsewhere, on System V-like systems, these functions implement
80 .\"O software signaling, entirely independent of the classical
81 .\"O .BR signal (2)
82 .\"O and
83 .\"O .BR kill (2)
84 .\"O functions.
85 .\"O The function
86 .\"O .BR ssignal ()
87 .\"O defines the action to take when the software signal with
88 .\"O number
89 .\"O .I signum
90 .\"O is raised using the function
91 .\"O .BR gsignal (),
92 .\"O and returns the previous such action or
93 .\"O .BR SIG_DFL .
94 一方、System V 風のシステムでは、これらの関数で、
95 従来の
96 .BR signal (2)
97
98 .BR kill (2)
99 の関数群とは完全に独立な、
100 ソフトウェア・シグナリングを実現している。
101 .BR ssignal ()
102 関数は、番号
103 .I signum
104 のソフトウェア・シグナルが
105 .BR gsignal ()
106 関数を使って発生された時にとるべきアクションを定義する。
107 .BR gsignal ()
108 の返り値は、一つ前に指定されていたアクション、もしくは
109 .B SIG_DFL
110 である。
111 .\"O The function
112 .\"O .BR gsignal ()
113 .\"O does the following: if no action (or the action
114 .\"O .BR SIG_DFL )
115 .\"O was
116 .\"O specified for
117 .\"O .IR signum ,
118 .\"O then it does nothing and returns 0.
119 .\"O If the action
120 .\"O .B SIG_IGN
121 .\"O was specified for
122 .\"O .IR signum ,
123 .\"O then it does nothing and returns 1.
124 .\"O Otherwise, it resets the action to
125 .\"O .B SIG_DFL
126 .\"O and calls
127 .\"O the action function with argument
128 .\"O .IR signum ,
129 .\"O and returns the value returned by that function.
130 .\"O The range of possible values
131 .\"O .I signum
132 .\"O varies (often 1-15 or 1-17).
133 .BR gsignal ()
134 は以下のような動作を行う:
135 .I signum
136 に対してアクションが指定されていないか、アクション
137 .B SIG_DFL
138 が指定されていた場合、何もせずに 0 を返す。
139 .I signum
140 に対して アクション
141 .B SIG_IGN
142 が指定されていた場合、何もせずに 1 を返す。
143 それ以外の場合、アクションを
144 .B SIG_DFL
145 にリセットし、引き数に
146 .I signum
147 を指定してアクション関数を呼び出して、アクション関数の返り値を返す。
148 .I signum
149 がとり得る値の範囲は実装により異なる (多くの場合 1〜15 か 1〜17 である)。
150 .\"O .SH "CONFORMING TO"
151 .SH 準拠
152 .\"O These functions are available under AIX, DG/UX, HP-UX, SCO, Solaris, Tru64.
153 .\"O They are called obsolete under most of these systems, and are
154 .\"O broken under Linux libc and glibc.
155 これらの関数は、AIX, DG/UX, HP-UX, SCO, Solaris, Tru64 で使用可能である。
156 これらのシステムのほとんどで廃止されたことになっており、
157 Linux の libc および glibc では正しく実装されていない。
158 .\"O Some systems also have
159 .\"O .BR gsignal_r ()
160 .\"O and
161 .\"O .BR ssignal_r ().
162 .BR gsignal_r ()
163
164 .BR ssignal_r ()
165 が実装されているシステムもある。
166 .\"O .SH "SEE ALSO"
167 .SH 関連項目
168 .BR kill (2),
169 .BR signal (2),
170 .BR raise (3)