1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
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.
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.
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.
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,
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>
28 .TH AIO_WRITE 3 2003-11-14 "" "Linux Programmer's Manual"
31 .\"O aio_write \- asynchronous write
37 .BI "int aio_write(struct aiocb *" aiocbp );
39 .\"O Link with \fI\-lrt\fP.
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 ,
51 .\"O The return status n can be retrieved upon completion using
52 .\"O .BR aio_return (3).
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
60 返り値 (return status) n は、完了時に
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.
71 が設定されない場合、カレントのファイル位置に関係なく、
73 .I aiocbp\->aio_offset
77 .\"O is set, the data is written at the end of the file.
79 が設定されている場合、データはファイルの終端に書き込まれる。
80 .\"O After this request, the value of the current file position is unspecified.
81 このリクエストの後の、カレントのファイル位置は規定されていない。
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 「非同期」とは「リクエストがキューに入れられたら、この呼び出しはすぐに返る」
90 呼び出しから戻った時に、書き込みは完了しているかも知れないし、
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
103 かつファイルがこれをサポートしている場合、
104 非同期操作は呼び出したプロセスの優先度から
105 .I aiocbp\->aio_reqprio
106 を引いた優先度で登録 (submit) される。
109 .\"O .I aiocbp\->aio_lio_opcode
112 .I aiocbp\->aio_lio_opcode
115 .\"O No data is written to a regular file beyond its maximum offset.
116 最大オフセットを超えた通常のファイルには、何もデータが書き込まれない。
117 .\"O .SH "RETURN VALUE"
119 .\"O On success, 0 is returned.
120 .\"O On error the request is not enqueued, \-1
121 .\"O is returned, and
123 .\"O is set appropriately.
124 .\"O If an error is first detected later, it will
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
134 エラーの場合、リクエストはキューに入れられず、
152 .\"O Out of resources.
157 .\"O is not a valid file descriptor open for writing.
159 は書き込みのためにオープンされた有効なファイルディスクリプタでない。
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 しかし開始位置が、このファイルの最大オフセットと同じかそれを超えている。
169 .\"O .IR aio_offset ,
170 .\"O .IR aio_reqprio ,
179 .\"O This function is not supported.
181 .\"O .SH "CONFORMING TO"
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
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
195 .\"O The memory areas involved must remain valid.
200 これに含まれるメモリ領域は、有効なままにしなければならない。