1 .\" Copyright (C) 2003 Free Software Foundation, Inc.
2 .\" This file is distributed according to the GNU General Public License.
3 .\" See the file COPYING in the top level source directory for details.
5 .\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI, all rights reserved.
6 .\" Translated Mon Mar 8 2003 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
8 .\"WORD: completion queue 完了キュー
10 .\" .de Sh \" Subsection
18 .\" .de Sp \" Vertical space (when we can't use .PP)
22 .\" .de Ip \" List item
24 .\" .ie \\n(.$>=3 .ne \\$3
28 .TH IO_GETEVENTS 2 2008-07-04 "Linux" "Linux Programmer's Manual"
31 .\"O io_getevents \- read asynchronous I/O events from the completion queue
32 io_getevents \- 完了キューから非同期 I/O イベントを読み出す
38 .B #include <linux/time.h>
39 .B #include <libaio.h>
40 .\" #include <linux/aio.h>
43 .BI "int io_getevents(aio_context_t " ctx_id ", long " min_nr ", long " nr ,
44 .BI " struct io_event *" events \
45 ", struct timespec *" timeout );
49 .\"O Link with \fI\-laio\fP.
52 .\"O .SH "DESCRIPTION"
55 .\"O .BR io_getevents ()
56 .\"O attempts to read at least \fImin_nr\fP events and
57 .\"O up to \fInr\fP events from the completion queue of the AIO context
58 .\"O specified by \fIctx_id\fP.
60 は、少なくとも \fImin_nr\fP の、最大 \fInr\fP 個の
61 イベントを、 \fIctx_id\fP で指定された AIO (非同期 I/O) コンテキストの
63 .\"O \fItimeout\fP specifies the amount of time to wait for events,
64 .\"O where a NULL timeout waits until at least \fImin_nr\fP events
66 \fItimeout\fP はイベント読み出しの待ち時間の合計を指定する。
67 タイムアウトに NULL を指定した場合、少なくとも \fImin_nr\fP 個のイベントが
69 .\"O Note that \fItimeout\fP is relative and will be updated if not NULL
70 .\"O and the operation blocks.
72 \fItimeout\fP は相対的な指定である。
73 NULL でない場合更新されることもありえる。
75 .\"O .SH "RETURN VALUE"
78 .\"O .BR io_getevents ()
79 .\"O returns the number of events read: 0 if no events are
80 .\"O available, or less than \fImin_nr\fP if the \fItimeout\fP has elapsed.
81 .\"O For the failure return, see NOTES.
85 イベントが一つも読み出されなかった場合は 0 が返され、
86 \fItimeout\fP 時間が経過した場合は \fImin_nr\fP 未満の値が返される。
87 失敗時の返り値については、「注意」の節を参照すること。
92 .\"O Either \fIevents\fP or \fItimeout\fP is an invalid pointer.
93 \fIevents\fP または \fItimeout\fP が無効なポインタである。
96 .\"O \fIctx_id\fP is invalid.
97 .\"O \fImin_nr\fP is out of range or \fInr\fP is
99 \fIctx_id\fP が無効である。もしくは、\fImin_nr\fP または \fInr\fP が
103 .\"O Interrupted by a signal handler; see
110 .\"O .BR io_getevents ()
111 .\"O is not implemented on this architecture.
113 がこのアーキテクチャでは実装されていない。
117 .\"O The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
118 非同期 I/O システム・コールは 2002年8月に Linux 2.5 で初めて登場した。
119 .\"O .SH "CONFORMING TO"
122 .\"O .BR io_getevents ()
123 .\"O is Linux-specific and should not be used in
124 .\"O programs that are intended to be portable.
126 は Linux 固有であり、移植を想定したプログラムで
130 .\"O Glibc does not provide a wrapper function for this system call.
131 glibc はこのシステムコール用のラッパー関数を提供していない。
133 .\"O The wrapper provided in
136 .\"O .BR io_getevents ()
137 .\"O does not follow the usual C library conventions for indicating error:
138 .\"O on error it returns a negated error number
139 .\"O (the negative of one of the values listed in ERRORS).
140 .\"O If the system call is invoked via
141 .\"O .BR syscall (2),
142 .\"O then the return value follows the usual conventions for
143 .\"O indicating an error: \-1, with
145 .\"O set to a (positive) value that indicates the error.
149 用に提供されているラッパー関数は、エラーの通知が通常の C ライブラリの
150 慣習にしたがっておらず、エラーの場合には負のエラー番号
151 (エラーの節に列挙されている値の一つを負にしたもの) が返り値となる。
153 経由でシステムコールを起動すると、返り値は通常のエラー通知の慣習に
154 したがってものとなり、エラーの場合には \-1 が返り、
156 にエラーを示す (正の) 値が設定される。
169 .\"O .\" The asynchronous I/O system calls were written by Benjamin LaHaise.
170 .\" 非同期 I/O システム・コールは Benjamin LaHaise が書いた。