OSDN Git Service

(split) LDP: draft snapshot generated from latest pthread/ja.po files.
[linuxjm/LDP_man-pages.git] / release / man3 / bsd_signal.3
1 .\" Copyright (c) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
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 .\" Japanese Version Copyright (c) 2007  Akihiro MOTOKI
24 .\"         all rights reserved.
25 .\" Translated 2007-06-02, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
26 .\" 
27 .\"WORD:        reliable        信頼性のある
28 .\"WORD:        unreliable      信頼性に欠ける
29 .\"WORD:        signal semantics        シグナル処理方式
30 .\" 
31 .TH BSD_SIGNAL 3 2009-03-15 "" "Linux Programmer's Manual"
32 .SH 名前
33 bsd_signal \- BSD 方式のシグナル処理
34 .SH 書式
35 .BR "#define _XOPEN_SOURCE" "       /* feature_test_macros(7) 参照 */"
36 .br
37 .B #include <signal.h>
38 .sp
39 .B typedef void (*sighandler_t)(int);
40 .sp
41 .BI "sighandler_t bsd_signal(int " signum ", sighandler_t " handler );
42 .SH 説明
43 .BR bsd_signal ()
44 関数は
45 .BR signal (2)
46 と同じ引き数をとり、同じ処理を実行する。
47
48 両者の違いは、
49 .BR bsd_signal ()
50 では信頼性のあるシグナル処理方式の提供が保証されていることである。
51 信頼性のあるシグナル処理方式は以下の特徴を持つ。
52 a) ハンドラが起動された場合に、シグナルの処理方法 (disposition) が
53 デフォルトにリセットされない、
54 b) シグナルハンドラの実行中は、それ以降に発生した同じシグナルの配送が
55 ブロックされない、
56 c) ハンドラが停止中の (blocking している) システムコールを
57 中断した場合、そのシステムコールが自動的に再開される。
58 移植性が必要なアプリケーションでは、
59 .BR signal (2)
60 でこれらが保証されることを前提にすべきではない。
61 .SH 返り値
62 .BR bsd_signal ()
63 関数はシグナルハンドラの直前の値を返す。
64 エラーの場合、
65 .B SIG_ERR
66 を返す。
67 .SH エラー
68 .BR signal (2)
69 と同じ。
70 .SH 準拠
71 4.2BSD, POSIX.1-2001.
72 POSIX.1-2008 では
73 .BR bsd_signal ()
74 の仕様が削除されている。
75 代わりに、
76 .BR sigaction (2)
77 の使用が推奨されている。
78 .SH 注意
79 .BR bsd_signal ()
80 の使用は避けるべきである。代わりに
81 .BR sigaction (2)
82 を使うこと。
83
84 最近の Linux システムでは、
85 .BR bsd_signal ()
86
87 .BR signal (2)
88 は等価である。しかし、以前のシステムでは、
89 .BR signal (2)
90 は信頼性に欠けるシグナル処理方式を提供していた。
91 詳細は
92 .BR signal (2)
93 を参照。
94
95 .I sighandler_t
96 を使っているのは GNU による拡張である。
97 この型は機能検査マクロ
98 .B _GNU_SOURCE
99 を定義した場合にのみ定義される。
100 .SH 関連項目
101 .BR sigaction (2),
102 .BR signal (2),
103 .BR sysv_signal (3),
104 .BR signal (7)