OSDN Git Service

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