OSDN Git Service

91ce219dde99da233fd6514ef8a7307b80b0043f
[linuxjm/LDP_man-pages.git] / draft / man3 / aio_write.3
1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
12 .\"
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 .\" GNU General Public License for more details.
17 .\"
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
21 .\" USA.
22 .\"
23 .\" Japanese Version Copyright (c) 2004 Yuichi SATO
24 .\"         all rights reserved.
25 .\" Translated Sat Jul 10 03:54:47 JST 2004
26 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
27 .\"
28 .TH AIO_WRITE 3 2003-11-14  "" "Linux Programmer's Manual"
29 .\"O .SH NAME
30 .SH 名前
31 .\"O aio_write \- asynchronous write
32 aio_write \- 非同期で書き込む
33 .\"O .SH SYNOPSIS
34 .SH 書式
35 .B "#include <aio.h>"
36 .sp
37 .BI "int aio_write(struct aiocb *" aiocbp );
38 .sp
39 .\"O Link with \fI\-lrt\fP.
40 \fI\-lrt\fP でリンクする。
41 .\"O .SH DESCRIPTION
42 .SH 説明
43 .\"O The
44 .\"O .BR aio_write ()
45 .\"O function requests an asynchronous "n = write(fd, buf, count)"
46 .\"O with fd, buf, count given by
47 .\"O .IR aiocbp\->aio_fildes ,
48 .\"O .IR aiocbp\->aio_buf ,
49 .\"O .IR aiocbp\->aio_nbytes ,
50 .\"O respectively.
51 .\"O The return status n can be retrieved upon completion using
52 .\"O .BR aio_return (3).
53 .BR aio_write ()
54 関数は非同期の "n = write(fd, buf, count)" をリクエストする。
55 ここで fd, buf, count は、それぞれ
56 .IR aiocbp\->aio_fildes ,
57 .IR aiocbp\->aio_buf ,
58 .I aiocbp\->aio_nbytes
59 で与えられる。
60 返り値 (return status) n は、完了時に
61 .BR aio_return (3)
62 を使って取得できる。
63 .LP
64 .\"O If
65 .\"O .B O_APPEND
66 .\"O is not set, the data is written starting at the
67 .\"O absolute file offset
68 .\"O .IR aiocbp\->aio_offset ,
69 .\"O regardless of the current file position.
70 .B O_APPEND
71 が設定されない場合、カレントのファイル位置に関係なく、
72 データは絶対ファイルオフセット
73 .I aiocbp\->aio_offset
74 を開始点として書き込まれる。
75 .\"O If
76 .\"O .B O_APPEND
77 .\"O is set, the data is written at the end of the file.
78 .B O_APPEND
79 が設定されている場合、データはファイルの終端に書き込まれる。
80 .\"O After this request, the value of the current file position is unspecified.
81 このリクエストの後の、カレントのファイル位置は規定されていない。
82 .LP
83 .\"O The "asynchronous" means that this call returns as soon as the
84 .\"O request has been enqueued; the write may or may not have completed
85 .\"O when the call returns.
86 .\"O One tests for completion using
87 .\"O .BR aio_error (3).
88 「非同期」とは「リクエストがキューに入れられたら、この呼び出しはすぐに返る」
89 ということである。
90 呼び出しから戻った時に、書き込みは完了しているかも知れないし、
91 完了していないかも知れない。
92 .BR aio_error (3)
93 を使うことで完了したかをテストできる。
94 .LP
95 .\"O If
96 .\"O .B _POSIX_PRIORITIZED_IO
97 .\"O is defined, and this file supports it,
98 .\"O then the asynchronous operation is submitted at a priority equal
99 .\"O to that of the calling process minus
100 .\"O .IR aiocbp\->aio_reqprio .
101 .B _POSIX_PRIORITIZED_IO
102 が定義されていて、
103 かつファイルがこれをサポートしている場合、
104 非同期操作は呼び出したプロセスの優先度から
105 .I aiocbp\->aio_reqprio
106 を引いた優先度で登録 (submit) される。
107 .LP
108 .\"O The field
109 .\"O .I aiocbp\->aio_lio_opcode
110 .\"O is ignored.
111 フィールド
112 .I aiocbp\->aio_lio_opcode
113 は無視される。
114 .LP
115 .\"O No data is written to a regular file beyond its maximum offset.
116 最大オフセットを超えた通常のファイルには、何もデータが書き込まれない。
117 .\"O .SH "RETURN VALUE"
118 .SH 返り値
119 .\"O On success, 0 is returned.
120 .\"O On error the request is not enqueued, \-1
121 .\"O is returned, and
122 .\"O .I errno
123 .\"O is set appropriately.
124 .\"O If an error is first detected later, it will
125 .\"O be reported via
126 .\"O .BR aio_return (3)
127 .\"O (returns status \-1) and
128 .\"O .BR aio_error (3)
129 .\"O (error status whatever one would have gotten in
130 .\"O .IR errno ,
131 .\"O such as
132 .\"O .BR EBADF ).
133 成功した場合、0 が返される。
134 エラーの場合、リクエストはキューに入れられず、
135 \-1 が返されて、
136 .I errno
137 が適切に設定される。
138 エラーは最初に検知された後で、
139 (状態 \-1 を返す)
140 .BR aio_return (3)
141
142 .RI ( errno
143 で取得できる
144 .B EBADF
145 のようなエラー状態を返す)
146 .BR aio_error (3)
147 で報告されるだろう。
148 .\"O .SH ERRORS
149 .SH エラー
150 .TP
151 .B EAGAIN
152 .\"O Out of resources.
153 リソースが足りない。
154 .TP
155 .B EBADF
156 .\"O .I aio_fildes
157 .\"O is not a valid file descriptor open for writing.
158 .I aio_fildes
159 は書き込みのためにオープンされた有効なファイルディスクリプタでない。
160 .TP
161 .B EFBIG
162 .\"O The file is a regular file, we want to write at least one byte,
163 .\"O but the starting position is at or beyond the maximum offset for this file.
164 ファイルは通常のファイルであり、少なくとも 1 バイトを書き込もうとしている。
165 しかし開始位置が、このファイルの最大オフセットと同じかそれを超えている。
166 .TP
167 .B EINVAL
168 .\"O One or more of
169 .\"O .IR aio_offset ,
170 .\"O .IR aio_reqprio ,
171 .\"O .I aio_nbytes
172 .\"O are invalid.
173 .IR aio_offset ,
174 .IR aio_reqprio ,
175 .I aio_nbytes
176 のうち 1 つ以上が無効である。
177 .TP
178 .B ENOSYS
179 .\"O This function is not supported.
180 この関数がサポートされていない。
181 .\"O .SH "CONFORMING TO"
182 .SH 準拠
183 POSIX.1-2001.
184 .\"O .SH NOTES
185 .SH 注意
186 .\"O It is a good idea to zero out the control block before use.
187 使用する前に制御ブロックを 0 にしておくのは、よい考えである。
188 .\"O This control block must not be changed while the write operation
189 .\"O is in progress.
190 この制御ブロックは、読み込み操作が進行している間は変更すべきでない。
191 .\"O The buffer area being written out
192 .\"O .\" or the control block of the operation
193 .\"O must not be accessed during the operation or undefined results may
194 .\"O occur.
195 .\"O The memory areas involved must remain valid.
196 読み込まれるバッファ領域は
197 .\" または操作の制御ブロックは
198 操作の最中にアクセスすべきではない。
199 さもないと起こる結果が不定になる。
200 これに含まれるメモリ領域は、有効なままにしなければならない。
201 .\"O .SH "SEE ALSO"
202 .SH 関連項目
203 .BR aio_cancel (3),
204 .BR aio_error (3),
205 .BR aio_fsync (3),
206 .BR aio_read (3),
207 .BR aio_return (3),
208 .BR aio_suspend (3)