OSDN Git Service

(split) LDP: Update draft pages
[linuxjm/LDP_man-pages.git] / draft / man2 / io_getevents.2
index 3ed9304..3f64007 100644 (file)
 .\" Copyright (C) 2003 Free Software Foundation, Inc.
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
 .\" This file is distributed according to the GNU General Public License.
-.\" See the file COPYING in the top level source directory for details.
+.\" %%%LICENSE_END
 .\"
-.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI, all rights reserved.
-.\" Translated Mon Mar  8 2003 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"*******************************************************************
 .\"
-.\"WORD:       completion queue        完了キュー
+.\" This file was generated with po4a. Translate the source file.
 .\"
-.\" .de Sh \" Subsection
-.\" .br
-.\" .if t .Sp
-.\" .ne 5
-.\" .PP
-.\" \fB\\$1\fP
-.\" .PP
-.\" ..
-.\" .de Sp \" Vertical space (when we can't use .PP)
-.\" .if t .sp .5v
-.\" .if n .sp
-.\" ..
-.\" .de Ip \" List item
-.\" .br
-.\" .ie \\n(.$>=3 .ne \\$3
-.\" .el .ne 3
-.\" .IP "\\$1" \\$2
-.\" ..
-.TH IO_GETEVENTS 2 2008-07-04 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
+.\"*******************************************************************
+.TH IO_GETEVENTS 2 2013\-04\-08 Linux "Linux Programmer's Manual"
 .SH 名前
-.\"O io_getevents \- read asynchronous I/O events from the completion queue
 io_getevents \- 完了キューから非同期 I/O イベントを読み出す
-.\"O .SH "SYNOPSIS"
 .SH 書式
 .nf
-.\" .ad l
-.\" .hy 0
-.B #include <linux/time.h>
-.B #include <libaio.h>
-.\" #include <linux/aio.h>
-.sp
-.\" .HP 19
-.BI "int io_getevents(aio_context_t " ctx_id ", long " min_nr ", long " nr ,
-.BI "                 struct io_event *" events \
-", struct timespec *" timeout );
-.\" .ad
-.\" .hy
-.sp
-.\"O Link with \fI\-laio\fP.
-\fI\-laio\fP とリンクする。
+\fB#include <linux/aio_abi.h>\fP         /* 必要な型の定義 */
+\fB#include <linux/time.h>\fP            /* 'struct timespec' の定義 */
+
+\fBint io_getevents(aio_context_t \fP\fIctx_id\fP\fB, long \fP\fImin_nr\fP\fB, long \fP\fInr\fP\fB,\fP
+\fB                 struct io_event *\fP\fIevents\fP\fB, struct timespec *\fP\fItimeout\fP\fB);\fP
 .fi
-.\"O .SH "DESCRIPTION"
+
+\fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。
 .SH 説明
 .PP
-.\"O .BR io_getevents ()
-.\"O attempts to read at least \fImin_nr\fP events and
-.\"O up to \fInr\fP events from the completion queue of the AIO context
-.\"O specified by \fIctx_id\fP.
-.BR io_getevents ()
-は、少なくとも \fImin_nr\fP の、最大 \fInr\fP 個の
-イベントを、 \fIctx_id\fP で指定された AIO (非同期 I/O) コンテキストの
-完了キューから読み出そうとする。
-.\"O \fItimeout\fP specifies the amount of time to wait for events,
-.\"O where a NULL timeout waits until at least \fImin_nr\fP events
-.\"O have been seen.
-\fItimeout\fP はイベント読み出しの待ち時間の合計を指定する。
-タイムアウトに NULL を指定した場合、少なくとも \fImin_nr\fP 個のイベントが
-読み出されるまで待つことを意味する。
-.\"O Note that \fItimeout\fP is relative and will be updated if not NULL
-.\"O and the operation blocks.
-注意点を以下にあげる:
-\fItimeout\fP は相対的な指定である。
-NULL でない場合更新されることもありえる。
-呼び出し元の動作は停止する。
-.\"O .SH "RETURN VALUE"
+\fBio_getevents\fP() システムコールは、少なくとも \fImin_nr\fP の、最大
+\fInr\fP 個のイベントを、 \fIctx_id\fP 引き数で指定された AIO (非同期 I/O)
+コンテキストの 完了キューから読み出そうとする。 \fItimeout\fP はイベント
+読み出しの待ち時間の合計を指定する。 タイムアウトに NULL を指定した場合、
+少なくとも \fImin_nr\fP 個のイベントが 読み出されるまで待つことを意味する。
+注意点を以下にあげる: \fItimeout\fP は相対的な指定である。
 .SH 返り値
-.\"O On success,
-.\"O .BR io_getevents ()
-.\"O returns the number of events read: 0 if no events are
-.\"O available, or less than \fImin_nr\fP if the \fItimeout\fP has elapsed.
-.\"O For the failure return, see NOTES.
-成功すると、
-.BR io_getevents ()
-は読み出したイベント数を返す。
-イベントが一つも読み出されなかった場合は 0 が返され、
-\fItimeout\fP 時間が経過した場合は \fImin_nr\fP 未満の値が返される。
-失敗時の返り値については、「注意」の節を参照すること。
-.\"O .SH "ERRORS"
+成功すると、 \fBio_getevents\fP()  は読み出したイベント数を返す。 イベントが一つも読み出されなかった場合は 0 が返され、
+\fItimeout\fP 時間が経過した場合は \fImin_nr\fP 未満の値が返される。 失敗時の返り値については、「注意」の節を参照すること。
 .SH エラー
-.TP
-.B EFAULT
-.\"O Either \fIevents\fP or \fItimeout\fP is an invalid pointer.
+.TP 
+\fBEFAULT\fP
 \fIevents\fP または \fItimeout\fP が無効なポインタである。
-.TP
-.B EINVAL
-.\"O \fIctx_id\fP is invalid.
-.\"O \fImin_nr\fP is out of range or \fInr\fP is
-.\"O out of range.
-\fIctx_id\fP が無効である。もしくは、\fImin_nr\fP または \fInr\fP が
-範囲外の値である。
-.TP
-.B EINTR
-.\"O Interrupted by a signal handler; see
-.\"O .BR signal (7).
-シグナルハンドラにより割り込まれた。
-.BR signal (7)
-参照。
-.TP
-.B ENOSYS
-.\"O .BR io_getevents ()
-.\"O is not implemented on this architecture.
-.BR io_getevents ()
-がこのアーキテクチャでは実装されていない。
-.\"O .SH "VERSIONS"
+.TP 
+\fBEINVAL\fP
+\fIctx_id\fP が無効である。もしくは、\fImin_nr\fP または \fInr\fP が 範囲外の値である。
+.TP 
+\fBEINTR\fP
+シグナルハンドラにより割り込まれた。 \fBsignal\fP(7)  参照。
+.TP 
+\fBENOSYS\fP
+\fBio_getevents\fP()  がこのアーキテクチャでは実装されていない。
 .SH バージョン
 .PP
-.\"O The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
-非同期 I/O システム・コールは 2002年8月に Linux 2.5 で初めて登場した。
-.\"O .SH "CONFORMING TO"
+非同期 I/O システム・コールは Linux 2.5 で初めて登場した。
 .SH 準拠
 .PP
-.\"O .BR io_getevents ()
-.\"O is Linux-specific and should not be used in
-.\"O programs that are intended to be portable.
-.BR io_getevents ()
-は Linux 固有であり、移植を想定したプログラムで
-使用すべきではない。
-.\"O .SH NOTES
+\fBio_getevents\fP()  は Linux 固有であり、移植を想定したプログラムで 使用すべきではない。
 .SH 注意
-.\"O Glibc does not provide a wrapper function for this system call.
-glibc はこのシステムコール用のラッパー関数を提供していない。
+.\" http://git.fedorahosted.org/git/?p=libaio.git
+glibc はこのシステムコールのラッパー関数を提供していない。
+\fBsyscall\fP(2) を使ってこのシステムコールを起動することができる。
+しかし、たいていは、このシステムコールを呼び出したいのではなく、
+ \fIlibaio\fP が提供している \fBio_getevents\fP ラッパー関数を呼び出したい
+場合がほとんどであろう。
 
-.\"O The wrapper provided in
-.\"O .I libaio
-.\"O for
-.\"O .BR io_getevents ()
-.\"O does not follow the usual C library conventions for indicating error:
-.\"O on error it returns a negated error number
-.\"O (the negative of one of the values listed in ERRORS).
-.\"O If the system call is invoked via
-.\"O .BR syscall (2),
-.\"O then the return value follows the usual conventions for
-.\"O indicating an error: \-1, with
-.\"O .I errno
-.\"O set to a (positive) value that indicates the error.
-.I libaio
-で
-.BR io_getevents ()
-用に提供されているラッパー関数は、エラーの通知が通常の C ライブラリの
-慣習にしたがっておらず、エラーの場合には負のエラー番号
-(エラーの節に列挙されている値の一つを負にしたもの) が返り値となる。
-.BR syscall (2)
-経由でシステムコールを起動すると、返り値は通常のエラー通知の慣習に
-したがってものとなり、エラーの場合には \-1 が返り、
-.I errno
+.\" But glibc is confused, since <libaio.h> uses 'io_context_t' to declare
+.\" the system call.
+\fIlibaio\fP のラッパー関数では \fIctx_id\fP 引き数に別の型
+(\fIio_context_t\fP) が使われることに注意すること。
+また、\fIlibaio\fP のラッパー関数は、エラーの通知が通常の C ライブラリの
+慣習にしたがっておらず、エラーの場合には負のエラー番号 (エラーの節に列
+挙されている値の一つを負にしたもの) が返り値となる点にも注意すること。
+\fBsyscall\fP(2) 経由でシステムコールを起動すると、返り値は通常のエラー通
+知の慣習に したがってものとなり、エラーの場合には \-1 が返り、 \fIerrno\fP
 にエラーを示す (正の) 値が設定される。
-.\"O .SH "SEE ALSO"
+.SH バグ
+無効な \fIctx_id\fP を指定した場合、エラー \fBEINVAL\fP が生成されず、セグメンテーション違反 (segmentation fault)
+が発生する場合がある。
 .SH 関連項目
 .PP
-.BR io_cancel (2),
-.BR io_destroy (2),
-.BR io_setup (2),
-.BR io_submit (2),
-.BR aio (7),
-.BR time (7)
-.\"O .\" .SH "NOTES"
-.\" .SH 注
-.\" .PP
-.\"O .\" The asynchronous I/O system calls were written by Benjamin LaHaise.
-.\" 非同期 I/O システム・コールは Benjamin LaHaise が書いた。
-.\"O .\" .SH AUTHOR
-.\" .SH 著者
+.\" .SH AUTHOR
 .\" Kent Yoder.
+\fBio_cancel\fP(2), \fBio_destroy\fP(2), \fBio_setup\fP(2), \fBio_submit\fP(2),
+\fBaio\fP(7), \fBtime\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。