OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[linuxjm/LDP_man-pages.git] / draft / man3 / sysv_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 SYSV_SIGNAL 3 2007-05-04 "" "Linux Programmer's Manual"
32 .\"O .SH NAME
33 .SH Ì¾Á°
34 .\"O sysv_signal \- signal handling with System V semantics
35 sysv_signal \- System V Êý¼°¤Î¥·¥°¥Ê¥ë½èÍý
36 .\"O .SH SYNOPSIS
37 .SH ½ñ¼°
38 .\"O .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
39 .BR "#define _GNU_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 sysv_signal(int " signum ", sighandler_t " handler );
46 .\"O .SH DESCRIPTION
47 .SH ÀâÌÀ
48 .\"O The
49 .\"O .BR sysv_signal ()
50 .\"O function takes the same arguments, and performs the same task, as
51 .\"O .BR signal (2).
52 .BR sysv_signal ()
53 ´Ø¿ô¤Ï
54 .BR signal (2)
55 ¤ÈƱ¤¸°ú¤­¿ô¤ò¤È¤ê¡¢Æ±¤¸½èÍý¤ò¼Â¹Ô¤¹¤ë¡£
56
57 .\"O However
58 .\"O .BR sysv_signal ()
59 .\"O provides the System V unreliable signal semantics, that is:
60 .\"O a) the disposition of the signal is reset to the default
61 .\"O when the handler is invoked;
62 .\"O b) delivery of further instances of the signal is not blocked while
63 .\"O the signal handler is executing; and
64 .\"O c) if the handler interrupts (certain) blocking system calls,
65 .\"O then the system call is not automatically restarted.
66 ¤·¤«¤·¤Ê¤¬¤é¡¢
67 .BR sysv_signal ()
68 ¤Ï System V ¤Î¿®ÍêÀ­¤Ë·ç¤±¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤òÄ󶡤·¤Æ¤¤¤ë¡£
69 ¿®ÍêÀ­¤Ë·ç¤±¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤Ï°Ê²¼¤ÎÆÃħ¤ò»ý¤Ä¡£
70 a) ¥Ï¥ó¥É¥é¤¬µ¯Æ°¤µ¤ì¤ë¤È¡¢¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡ (disposition) ¤¬
71 ¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¡¢
72 b) ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Î¼Â¹ÔÃæ¤Ï¡¢¤½¤ì°Ê¹ß¤ËȯÀ¸¤·¤¿Æ±¤¸¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤¬
73 ¥Ö¥í¥Ã¥¯¤µ¤ì¤Ê¤¤¡¢
74 c) ¥Ï¥ó¥É¥é¤¬Ää»ßÃæ¤Î (blocking ¤·¤Æ¤¤¤ë) ¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÃæÃǤ·¤¿¾ì¹ç¡¢
75 ¼«Æ°Åª¤ËºÆ³«¤µ¤ì¤Ê¤¤¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤¢¤ë¡£
76 .\"O .SH "RETURN VALUE"
77 .SH ÊÖ¤êÃÍ
78 .\"O The
79 .\"O .BR sysv_signal ()
80 .\"O function returns the previous value of the signal handler, or
81 .\"O .B SIG_ERR
82 .\"O on error.
83 .BR sysv_signal ()
84 ´Ø¿ô¤Ï¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎľÁ°¤ÎÃͤòÊÖ¤¹¡£
85 ¥¨¥é¡¼¤Î¾ì¹ç¡¢
86 .B SIG_ERR
87 ¤òÊÖ¤¹¡£
88 .\"O .SH ERRORS
89 .SH ¥¨¥é¡¼
90 .\"O As for
91 .\"O .BR signal (2).
92 .BR signal (2)
93 ¤ÈƱ¤¸¡£
94 .\"O .SH "CONFORMING TO"
95 .SH ½àµò
96 .\"O This function is nonstandard.
97 ¤³¤Î´Ø¿ô¤ÏÈóɸ½à¤Ç¤¢¤ë¡£
98 .\"O .SH NOTES
99 .SH Ãí°Õ
100 .\"O Use of
101 .\"O .BR sysv_signal ()
102 .\"O should be avoided; use
103 .\"O .BR sigaction (2)
104 .\"O instead.
105 .BR sysv_signal ()
106 ¤Î»ÈÍѤÏÈò¤±¤ë¤Ù¤­¤Ç¤¢¤ë¡£Âå¤ï¤ê¤Ë
107 .BR sigaction (2)
108 ¤ò»È¤¦¤³¤È¡£
109
110 .\"O On older Linux systems,
111 .\"O .BR sysv_signal ()
112 .\"O and
113 .\"O .BR signal (2)
114 .\"O were equivalent.
115 .\"O But on newer systems,
116 .\"O .BR signal (2)
117 .\"O provides reliable signal semantics; see
118 .\"O .BR signal (2)
119 .\"O for details.
120 °ÊÁ°¤Î Linux ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢
121 .BR sysv_signal ()
122 ¤È
123 .BR signal (2)
124 ¤ÏÅù²Á¤Ç¤¢¤Ã¤¿¡£¤·¤«¤·¡¢¿·¤·¤á¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢
125 .BR signal (2)
126 ¤Ï¿®ÍêÀ­¤Î¤¢¤ë¥·¥°¥Ê¥ë½èÍýÊý¼°¤òÄ󶡤·¤Æ¤¤¤ë¡£
127 ¾ÜºÙ¤Ï
128 .BR signal (2)
129 ¤ò»²¾È¡£
130
131 .\"O The use of
132 .\"O .I sighandler_t
133 .\"O is a GNU extension;
134 .\"O this type is only defined if 
135 .\"O this type is only defined if
136 .\"O the
137 .\"O .B _GNU_SOURCE
138 .\"O feature test macro is defined.
139 .I sighandler_t
140 ¤ò»È¤Ã¤Æ¤¤¤ë¤Î¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£
141 ¤³¤Î·¿¤Ïµ¡Ç½¸¡ºº¥Þ¥¯¥í
142 .B _GNU_SOURCE
143 ¤òÄêµÁ¤·¤¿¾ì¹ç¤Ë¤Î¤ßÄêµÁ¤µ¤ì¤ë¡£
144 .\"O .SH "SEE ALSO"
145 .SH ´ØÏ¢¹àÌÜ
146 .BR sigaction (2),
147 .BR signal (2),
148 .BR bsd_signal (3),
149 .BR signal (7)