.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) .\" .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, write to the Free .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. .\" .\" Japanese Version Copyright (c) 2004 Yuichi SATO .\" all rights reserved. .\" Translated Mon Jul 5 00:46:45 JST 2004 .\" by Yuichi SATO .\" .TH AIO_READ 3 2003-11-14 "" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O aio_read \- asynchronous read aio_read \- 非同期で読み込む .\"O .SH SYNOPSIS .SH 書式 .B "#include " .sp .BI "int aio_read(struct aiocb *" aiocbp ); .sp .\"O Link with \fI\-lrt\fP. \fI\-lrt\fP でリンクする。 .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR aio_read () .\"O function requests an asynchronous "n = read(fd, buf, count)" .\"O with fd, buf, count given by .\"O .IR aiocbp\->aio_fildes , .\"O .IR aiocbp\->aio_buf , .\"O .IR aiocbp\->aio_nbytes , .\"O respectively. .\"O The return status n can be retrieved upon completion using .\"O .BR aio_return (3). .BR aio_read () 関数は非同期の "n = read(fd, buf, count)" をリクエストする。 ここで fd, buf, count は、それぞれ .IR aiocbp\->aio_fildes , .IR aiocbp\->aio_buf , .I aiocbp\->aio_nbytes で与えられる。 返り値 (return status) n は、完了時に .BR aio_return (3) を使って取得できる。 .LP .\"O The data is read starting at the absolute file offset .\"O .IR aiocbp\->aio_offset , .\"O regardless of the current file position. .\"O After this request, .\"O the value of the current file position is unspecified. データは、カレントのファイル位置に関係なく、絶対ファイルオフセット .I aiocbp\->aio_offset を開始点として読み込まれる。 このリクエスト後の、カレントのファイル位置は規定されていない。 .LP .\"O The "asynchronous" means that this call returns as soon as the .\"O request has been enqueued; the read may or may not have completed .\"O when the call returns. .\"O One tests for completion using .\"O .BR aio_error (3). 「非同期」とは「リクエストがキューに入れられたら、この呼び出しはすぐに返る」 ということである。 呼び出しから戻った時に、読み込みは完了しているかも知れないし、 完了していないかも知れない。 .BR aio_error (3) を使うことで完了したかをテストできる。 .LP .\"O If .\"O .B _POSIX_PRIORITIZED_IO .\"O is defined, and this file supports it, .\"O then the asynchronous operation is submitted at a priority equal .\"O to that of the calling process minus .\"O .IR aiocbp\->aio_reqprio . .B _POSIX_PRIORITIZED_IO が定義されていて、 かつファイルがこれをサポートしている場合、 非同期操作は呼び出したプロセスの優先度から .I aiocbp\->aio_reqprio を引いた優先度で登録 (submit) される。 .LP .\"O The field .\"O .I aiocbp\->aio_lio_opcode .\"O is ignored. フィールド .I aiocbp\->aio_lio_opcode は無視される。 .LP .\"O No data is read from a regular file beyond its maximum offset. 最大オフセットを超えた通常のファイルからは、何もデータが読み込まれない。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O On success, 0 is returned. .\"O On error the request is not enqueued, \-1 .\"O is returned, and .\"O .I errno .\"O is set appropriately. .\"O If an error is first detected later, it will .\"O be reported via .\"O .BR aio_return (3) .\"O (returns status \-1) and .\"O .BR aio_error (3) .\"O (error status whatever one would have gotten in .\"O .IR errno , .\"O such as .\"O .BR EBADF ). 成功した場合、0 が返される。 エラーの場合、リクエストはキューに入れられず、 \-1 が返されて、 .I errno が適切に設定される。 エラーは最初に検知された後で、 (状態 \-1 を返す) .BR aio_return (3) と .RI ( errno で取得できる .B EBADF のようなエラー状態を返す) .BR aio_error (3) で報告されるだろう。 .\"O .SH ERRORS .SH エラー .TP .B EAGAIN .\"O Out of resources. リソースが足りない。 .TP .B EBADF .\"O .I aio_fildes .\"O is not a valid file descriptor open for reading. .I aio_fildes は読み込みのためにオープンされた有効なファイルディスクリプタでない。 .TP .B EINVAL .\"O One or more of .\"O .IR aio_offset , .\"O .IR aio_reqprio , .\"O .I aio_nbytes .\"O are invalid. .IR aio_offset , .IR aio_reqprio , .I aio_nbytes のうち 1 つ以上が無効である。 .TP .B ENOSYS .\"O This function is not supported. この関数がサポートされていない。 .TP .B EOVERFLOW .\"O The file is a regular file, we start reading before end-of-file .\"O and want at least one byte, but the starting position is past .\"O the maximum offset for this file. ファイルが通常のファイルであり、 ファイルの終端の前から読み込みを開始して、 少なくとも 1 バイトを読み込もうとした。 しかし開始位置がこのファイルの最大オフセットを超えていた。 .\"O .SH "CONFORMING TO" .SH 準拠 POSIX.1-2001. .\"O .SH NOTES .SH 注意 .\"O It is a good idea to zero out the control block before use. 使用する前に制御ブロックを 0 にしておくのは、よい考えである。 .\"O This control block must not be changed while the read operation .\"O is in progress. この制御ブロックは、読み込み操作が進行している間は変更すべきでない。 .\"O The buffer area being read into .\"O .\" or the control block of the operation .\"O must not be accessed during the operation or undefined results may .\"O occur. .\"O The memory areas involved must remain valid. 読み込まれるバッファ領域は .\" または操作の制御ブロックは 操作の最中にアクセスすべきではない。 さもないと起こる結果が不定になる。 これに含まれるメモリ領域は、有効なままにしなければならない。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR aio_cancel (3), .BR aio_error (3), .BR aio_fsync (3), .BR aio_return (3), .BR aio_suspend (3), .BR aio_write (3)