OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man3 / siginterrupt.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
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 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified Sun Jul 25 10:40:51 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified Sun Apr 14 16:20:34 1996 by Andries Brouwer (aeb@cwi.nl)
29 .\"
30 .\" Japanese Version Copyright (c) 1998 HANATAKA Shinya
31 .\"         all rights reserved.
32 .\" Translated Sun May 24 13:44:00 JST 1998
33 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
34 .\"
35 .TH SIGINTERRUPT 3 2010-09-26 "" "Linux Programmer's Manual"
36 .\"O .SH NAME
37 .SH Ì¾Á°
38 .\"O siginterrupt \- allow signals to interrupt system calls
39 siginterrupt \- ¥·¥°¥Ê¥ë¤Ç¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ë³ä¤ê¹þ¤à¤³¤È¤òµö¤¹
40 .\"O .SH SYNOPSIS
41 .SH ½ñ¼°
42 .nf
43 .B #include <signal.h>
44 .sp
45 .BI "int siginterrupt(int " sig ", int " flag );
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 siginterrupt ():
57 .ad l
58 .RS 4
59 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
60 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
61 .br
62 || /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200809L
63 .RE
64 .ad
65 .\"O .SH DESCRIPTION
66 .SH ÀâÌÀ
67 .\"O The
68 .\"O .BR siginterrupt ()
69 .\"O function changes the restart behavior when
70 .\"O a system call is interrupted by the signal \fIsig\fP.
71 .\"O If the \fIflag\fP
72 .\"O argument is false (0), then system calls will be restarted if interrupted
73 .\"O by the specified signal \fIsig\fP.
74 .\"O This is the default behavior in Linux.
75 .\"O However, when a new signal handler is specified with the
76 .\"O .BR signal (2)
77 .\"O function, the system call is interrupted by default.
78 .BR siginterrupt ()
79 ´Ø¿ô¤Ï¡¢¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤¬¥·¥°¥Ê¥ë \fIsig\fP
80 ¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¸å¡¢ºÆ¼Â¹Ô¤ÎºÝ¤Î¿¶¤ëÉñ¤¤¤òÊѹ¹¤¹¤ë¡£
81 \fIflag\fP °ú¤­¿ô¤¬µ¶ (0) ¤Ê¤é¤Ð¡¢¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤¬»ØÄꤷ¤¿
82 ¥·¥°¥Ê¥ë \fIsig\fP ¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¸å¤Ë¡¢¤½¤Î¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï
83 ºÆ¼Â¹Ô¤µ¤ì¤ë¡£¤³¤ì¤Ï Linux ¤Ë¤ª¤¤¤Æ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ç¤¢¤ë¡£°ìÊý¡¢
84 .BR signal (2)
85 ´Ø¿ô¤Ç¿·¤·¤¤¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¡¼¤ò»ØÄꤷ¤¿¾ì¹ç¤Ï
86 ¥Ç¥Õ¥©¥ë¥È¤Ç¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ÏÃæÃǤµ¤ì¤ë¡£
87 .PP
88 .\"O If the \fIflag\fP argument is true (1) and no data has been transferred,
89 .\"O then a system call interrupted by the signal \fIsig\fP will return \-1
90 .\"O and \fIerrno\fP will be set to
91 .\"O .BR EINTR .
92 \fIflag\fP °ú¤­¿ô¤¬¿¿ (1) ¤Ç¥Ç¡¼¥¿¤ÎžÁ÷¤¬Á´¤¯¹Ô¤Ê¤ï¤ì¤Æ¤¤¤Ê¤¤¤Ê¤é¤Ð¡¢
93 ¥·¥°¥Ê¥ë \fIsig\fP ¤Ç¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ÏÃæÃǤµ¤ì¤Æ¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢
94 \fIerrno\fP ¤Ë
95 .B EINTR
96 ¤¬ÀßÄꤵ¤ì¤ë¡£
97 .PP
98 .\"O If the \fIflag\fP argument is true (1) and data transfer has started,
99 .\"O then the system call will be interrupted and will return the actual
100 .\"O amount of data transferred.
101 \fIflag\fP °ú¤­¿ô¤¬¿¿ (1) ¤Ç¥Ç¡¼¥¿¤ÎžÁ÷¤¬³«»Ï¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢
102 ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ÏÃæÃǤµ¤ì¡¢¤½¤ì¤Þ¤Ç¤Ë¼ÂºÝ¤ËžÁ÷¤µ¤ì¤¿¥Ç¡¼¥¿
103 ¤ÎÎ̤¬ÊÖ¤µ¤ì¤ë¡£
104 .\"O .SH "RETURN VALUE"
105 .SH ÊÖ¤êÃÍ
106 .\"O The
107 .\"O .BR siginterrupt ()
108 .\"O function returns 0 on success, or \-1 if the
109 .\"O signal number \fIsig\fP is invalid.
110 .BR siginterrupt ()
111 ´Ø¿ô¤ÏÀ®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£
112 ¥·¥°¥Ê¥ëÈÖ¹æ \fIsig\fP ¤¬ÉÔÀµ¤Ê¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£
113 .\"O .SH ERRORS
114 .SH ¥¨¥é¡¼
115 .TP
116 .B EINVAL
117 .\"O The specified signal number is invalid.
118 »ØÄꤷ¤¿¥·¥°¥Ê¥ëÈֹ椬ÉÔÀµ¤Ç¤¢¤ë¡£
119 .\"O .SH "CONFORMING TO"
120 .SH ½àµò
121 4.3BSD, POSIX.1-2001.
122 .\"O POSIX.1-2008 marks
123 .\"O .BR siginterrupt ()
124 .\"O as obsolete, recommending the use of
125 .\"O .BR sigaction (2)
126 .\"O with the
127 .\"O .B SA_RESTART
128 .\"O flag instead.
129 POSIX.1-2008 ¤Ï¡¢
130 .BR siginterrupt ()
131 ¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£
132 Âå¤ï¤ê¤Ë¡¢
133 .BR sigaction (2)
134 ¤Ë
135 .B SA_RESTART
136 ¥Õ¥é¥°¤ò»ØÄꤷ¤Æ»È¤¦¤³¤È¤ò¿ä¾©¤·¤Æ¤¤¤ë¡£
137 .\"O .SH "SEE ALSO"
138 .SH ´ØÏ¢¹àÌÜ
139 .BR signal (2)