OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / draft / 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 .\"O .SH NAME
33 .SH Ì¾Á°
34 .\"O bsd_signal \- signal handling with BSD semantics
35 bsd_signal \- BSD Êý¼°¤Î¥·¥°¥Ê¥ë½èÍý
36 .\"O .SH SYNOPSIS
37 .SH ½ñ¼°
38 .B #define _XOPEN_SOURCE
39 .br
40 .B #include <signal.h>
41 .sp
42 .B typedef void (*sighandler_t)(int);
43 .sp
44 .BI "sighandler_t bsd_signal(int " signum ", sighandler_t " handler );
45 .\"O .SH DESCRIPTION
46 .SH ÀâÌÀ
47 .\"O The
48 .\"O .BR bsd_signal ()
49 .\"O function takes the same arguments, and performs the same task, as
50 .\"O .BR signal (2).
51 .BR bsd_signal ()
52 ´Ø¿ô¤Ï
53 .BR signal (2)
54 ¤ÈƱ¤¸°ú¤­¿ô¤ò¤È¤ê¡¢Æ±¤¸½èÍý¤ò¼Â¹Ô¤¹¤ë¡£
55
56 .\"O The difference between the two is that
57 .\"O .BR bsd_signal ()
58 .\"O is guaranteed to provide reliable signal semantics, that is:
59 .\"O a) the disposition of the signal is not reset to the default
60 .\"O when the handler is invoked;
61 .\"O b) delivery of further instances of the signal is blocked while
62 .\"O the signal handler is executing; and
63 .\"O c) if the handler interrupts a blocking system call,
64 .\"O then the system call is automatically restarted.
65 .\"O A portable application cannot rely on
66 .\"O .BR signal (2)
67 .\"O to provide these guarantees.
68 ξ¼Ô¤Î°ã¤¤¤Ï¡¢
69 .BR bsd_signal ()
70 ¤Ç¤Ï¿®ÍêÀ­¤Î¤¢¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤ÎÄ󶡤¬Êݾڤµ¤ì¤Æ¤¤¤ë¤³¤È¤Ç¤¢¤ë¡£
71 ¿®ÍêÀ­¤Î¤¢¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤Ï°Ê²¼¤ÎÆÃħ¤ò»ý¤Ä¡£
72 a) ¥Ï¥ó¥É¥é¤¬µ¯Æ°¤µ¤ì¤¿¾ì¹ç¤Ë¡¢¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡ (disposition) ¤¬
73 ¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤Ê¤¤¡¢
74 b) ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¼Â¹ÔÃæ¤Ï¡¢¤½¤ì°Ê¹ß¤ËȯÀ¸¤·¤¿Æ±¤¸¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤¬
75 ¥Ö¥í¥Ã¥¯¤µ¤ì¤Ê¤¤¡¢
76 c) ¥Ï¥ó¥É¥é¤¬Ää»ßÃæ¤Î (blocking ¤·¤Æ¤¤¤ë) ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò
77 ÃæÃǤ·¤¿¾ì¹ç¡¢¤½¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¼«Æ°Åª¤ËºÆ³«¤µ¤ì¤ë¡£
78 °Ü¿¢À­¤¬É¬Íפʥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢
79 .BR signal (2)
80 ¤Ç¤³¤ì¤é¤¬Êݾڤµ¤ì¤ë¤³¤È¤òÁ°Äó¤Ë¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£
81 .\"O .SH "RETURN VALUE"
82 .SH ÊÖ¤êÃÍ
83 .\"O The
84 .\"O .BR bsd_signal ()
85 .\"O function returns the previous value of the signal handler, or
86 .\"O .B SIG_ERR
87 .\"O on error.
88 .BR bsd_signal ()
89 ´Ø¿ô¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎľÁ°¤ÎÃͤòÊÖ¤¹¡£
90 ¥¨¥é¡¼¤Î¾ì¹ç¡¢
91 .B SIG_ERR
92 ¤òÊÖ¤¹¡£
93 .\"O .SH ERRORS
94 .SH ¥¨¥é¡¼
95 .\"O As for
96 .\"O .BR signal (2).
97 .BR signal (2)
98 ¤ÈƱ¤¸¡£
99 .\"O .SH "CONFORMING TO"
100 .SH ½àµò
101 4.2BSD, POSIX.1-2001.
102 .\"O POSIX.1-2008 removes the specification of
103 .\"O .BR bsd_signal (),
104 .\"O recommending the use of
105 .\"O .BR sigaction (2)
106 .\"O instead.
107 POSIX.1-2008 ¤Ç¤Ï
108 .BR bsd_signal ()
109 ¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£
110 Âå¤ï¤ê¤Ë¡¢
111 .BR sigaction (2)
112 ¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£
113 .\"O .SH NOTES
114 .SH Ãí°Õ
115 .\"O Use of
116 .\"O .BR bsd_signal ()
117 .\"O should be avoided; use
118 .\"O .BR sigaction (2)
119 .\"O instead.
120 .BR bsd_signal ()
121 ¤Î»ÈÍѤÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£Âå¤ï¤ê¤Ë
122 .BR sigaction (2)
123 ¤ò»È¤¦¤³¤È¡£
124
125 .\"O On modern Linux systems,
126 .\"O .BR bsd_signal ()
127 .\"O and
128 .\"O .BR signal (2)
129 .\"O are equivalent.
130 .\"O But on older systems,
131 .\"O .BR signal (2)
132 .\"O provided unreliable signal semantics; see
133 .\"O .BR signal (2)
134 .\"O for details.
135 ºÇ¶á¤Î Linux ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢
136 .BR bsd_signal ()
137 ¤È
138 .BR signal (2)
139 ¤ÏÅù²Á¤Ç¤¢¤ë¡£¤·¤«¤·¡¢°ÊÁ°¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢
140 .BR signal (2)
141 ¤Ï¿®ÍêÀ­¤Ë·ç¤±¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤òÄ󶡤·¤Æ¤¤¤¿¡£
142 ¾ÜºÙ¤Ï
143 .BR signal (2)
144 ¤ò»²¾È¡£
145
146 .\"O The use of
147 .\"O .I sighandler_t
148 .\"O is a GNU extension;
149 .\"O this type is only defined if the
150 .\"O .B _GNU_SOURCE
151 .\"O feature test macro is defined.
152 .I sighandler_t
153 ¤ò»È¤Ã¤Æ¤¤¤ë¤Î¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£
154 ¤³¤Î·¿¤Ïµ¡Ç½¸¡ºº¥Þ¥¯¥í
155 .B _GNU_SOURCE
156 ¤òÄêµÁ¤·¤¿¾ì¹ç¤Ë¤Î¤ßÄêµÁ¤µ¤ì¤ë¡£
157 .\"O .SH "SEE ALSO"
158 .SH ´ØÏ¢¹àÌÜ
159 .BR sigaction (2),
160 .BR signal (2),
161 .BR sysv_signal (3),
162 .BR feature_test_macros (7),
163 .BR signal (7)