OSDN Git Service

3c899892337e6ca40bf3b1203483c8b1ad15cad2
[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 2011-09-09 "" "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 .BR siginterrupt ()
76 関数は、システム・コールがシグナル \fIsig\fP
77 によって割り込まれた後、再実行の際の振る舞いを変更する。
78 \fIflag\fP 引き数が偽 (0) ならば、システム・コールが指定した
79 シグナル \fIsig\fP によって割り込まれた後に、そのシステム・コールは
80 再実行される。これは Linux においてデフォルトの動作である。
81 .PP
82 .\"O If the \fIflag\fP argument is true (1) and no data has been transferred,
83 .\"O then a system call interrupted by the signal \fIsig\fP will return \-1
84 .\"O and \fIerrno\fP will be set to
85 .\"O .BR EINTR .
86 \fIflag\fP 引き数が真 (1) でデータの転送が全く行なわれていないならば、
87 シグナル \fIsig\fP でシステム・コールは中断されて、\-1 が返され、
88 \fIerrno\fP に
89 .B EINTR
90 が設定される。
91 .PP
92 .\"O If the \fIflag\fP argument is true (1) and data transfer has started,
93 .\"O then the system call will be interrupted and will return the actual
94 .\"O amount of data transferred.
95 \fIflag\fP 引き数が真 (1) でデータの転送が開始されていれば、
96 システム・コールは中断され、それまでに実際に転送されたデータ
97 の量が返される。
98 .\"O .SH "RETURN VALUE"
99 .SH 返り値
100 .\"O The
101 .\"O .BR siginterrupt ()
102 .\"O function returns 0 on success, or \-1 if the
103 .\"O signal number \fIsig\fP is invalid.
104 .BR siginterrupt ()
105 関数は成功した場合 0 を返す。
106 シグナル番号 \fIsig\fP が不正な場合は \-1 を返す。
107 .\"O .SH ERRORS
108 .SH エラー
109 .TP
110 .B EINVAL
111 .\"O The specified signal number is invalid.
112 指定したシグナル番号が不正である。
113 .\"O .SH "CONFORMING TO"
114 .SH 準拠
115 4.3BSD, POSIX.1-2001.
116 .\"O POSIX.1-2008 marks
117 .\"O .BR siginterrupt ()
118 .\"O as obsolete, recommending the use of
119 .\"O .BR sigaction (2)
120 .\"O with the
121 .\"O .B SA_RESTART
122 .\"O flag instead.
123 POSIX.1-2008 は、
124 .BR siginterrupt ()
125 を廃止予定としている。
126 代わりに、
127 .BR sigaction (2)
128
129 .B SA_RESTART
130 フラグを指定して使うことを推奨している。
131 .\"O .SH "SEE ALSO"
132 .SH 関連項目
133 .BR signal (2)