OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / draft / man2 / io_getevents.2
index a94c577..e5c89cf 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
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
 .\"
 .\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI, all rights reserved.
 .\" Translated Mon Mar  8 2003 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2012-05-29, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-03-25, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-05-01, Akihiro MOTOKI <amotoki@gmail.com>
 .\"
-.\"WORD:       completion queue        ´°Î»¥­¥å¡¼
-.\"
-.\" .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
-.SH Ì¾Á°
-.\"O io_getevents \- read asynchronous I/O events from the completion queue
-io_getevents \- ´°Î»¥­¥å¡¼¤«¤éÈóƱ´ü I/O ¥¤¥Ù¥ó¥È¤òÆɤ߽Ф¹
-.\"O .SH "SYNOPSIS"
-.SH ½ñ¼°
+.TH IO_GETEVENTS 2 2013\-04\-08 Linux "Linux Programmer's Manual"
+.SH 名前
+io_getevents \- 完了キューから非同期 I/O イベントを読み出す
+.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"
-.SH ÀâÌÀ
+
+\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"
-.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"
-.SH ¥¨¥é¡¼
-.TP
-.B EFAULT
-.\"O Either \fIevents\fP or \fItimeout\fP is an invalid pointer.
-\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"
-.SH ¥Ð¡¼¥¸¥ç¥ó
+\fBio_getevents\fP() システムコールは、少なくとも \fImin_nr\fP の、最大
+\fInr\fP 個のイベントを、 \fIctx_id\fP 引き数で指定された AIO (非同期 I/O)
+コンテキストの 完了キューから読み出そうとする。 \fItimeout\fP はイベント
+読み出しの待ち時間の合計を指定する。 タイムアウトに NULL を指定した場合、
+少なくとも \fImin_nr\fP 個のイベントが 読み出されるまで待つことを意味する。
+注意点を以下にあげる: \fItimeout\fP は相対的な指定である。
+.SH 返り値
+成功すると、 \fBio_getevents\fP()  は読み出したイベント数を返す。 イベントが一つも読み出されなかった場合は 0 が返され、
+\fItimeout\fP 時間が経過した場合は \fImin_nr\fP 未満の値が返される。 失敗時の返り値については、「注意」の節を参照すること。
+.SH エラー
+.TP 
+\fBEFAULT\fP
+\fIevents\fP または \fItimeout\fP が無効なポインターである。
+.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"
-.SH ½àµò
+非同期 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
-.SH Ãí°Õ
-.\"O Glibc does not provide a wrapper function for this system call.
-glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ëÍѤΥé¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£
+\fBio_getevents\fP()  は Linux 固有であり、移植を想定したプログラムで 使用すべきではない。
+.SH 注意
+.\" 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
-¤Ë¥¨¥é¡¼¤ò¼¨¤¹ (Àµ¤Î) Ãͤ¬ÀßÄꤵ¤ì¤ë¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
+.\" 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
+にエラーを示す (正の) 値が設定される。
+.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.79 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。