io_geteventsのヘルプ・マニュアル
日本語 英語
io_getevents --help
man io_getevents
IO_GETEVENTS(2) Linux Programmer’s Manual IO_GETEVENTS(2)
名前
io_getevents - 完了キューから非同期 I/O イベントを読み出す
書式
#include
#include
int io_getevents(aio_context_t ctx_id, long min_nr, long nr,
struct io_event *events, struct timespec *timeout);
-laio とリンクする。
説明
io_getevents() は 、 少 な くとも min_nr の、最大 nr 個のイベントを、
ctx_id で指定された AIO (非同期 I/O) コンテキストの完了キューから読み出
そうとする。 timeout はイベント読み出しの待ち時間の合計を指定する。タイ
ムアウトに NULL を指定した場合、少なくとも min_nr 個のイベントが読み 出
さ れるまで待つことを意味する。注意点を以下にあげる: timeout は相対的な
指定である。 NULL でない場合更新されることもありえる。呼び出し元の動 作
は停止する。
返り値
成 功すると、 io_getevents() は読み出したイベント数を返す。イベントが一
つも読み出されなかった場合は 0 が返され、 timeout 時間が経過した場合 は
min_nr 未満の値が返される。失敗時の返り値については、「注意」の節を参照
すること。
エラー
EFAULT events または timeout が無効なポインタである。
EINVAL ctx_id が無効である。もしくは、min_nr または nr が範囲外の値であ
る。
EINTR シグナルハンドラにより割り込まれた。 signal(7) 参照。
ENOSYS io_getevents() がこのアーキテクチャでは実装されていない。
バージョン
非同期 I/O システム・コールは 2002年8月に Linux 2.5 で初めて登場した。
準拠
io_getevents() は Linux 固有であり、移植を想定したプログラムで使用すべ
きではない。
注意
glibc はこのシステムコール用のラッパー関数を提供していない。
libaio で io_getevents() 用に提供されているラッパー関数は、エラーの通知
が通常の C ライブラリの慣習にしたがっておらず、エラーの場合には負のエラ
ー番号 (エラーの節に列挙されている値の一つを負にしたもの) が返り値と な
る 。 syscall(2) 経由でシステムコールを起動すると、返り値は通常のエラー
通知の慣習にしたがってものとなり、エラーの場合には -1 が返り、 errno に
エラーを示す (正の) 値が設定される。
関連項目
io_cancel(2), io_destroy(2), io_setup(2), io_submit(2), time(7)
Linux 2008-07-04 IO_GETEVENTS(2)
IO_GETEVENTS(2) Linux Programmer’s Manual IO_GETEVENTS(2)
NAME
io_getevents - read asynchronous I/O events from the completion queue
SYNOPSIS
#include
#include
int io_getevents(aio_context_t ctx_id, long min_nr, long nr,
struct io_event *events, struct timespec *timeout);
Link with -laio.
DESCRIPTION
io_getevents() attempts to read at least min_nr events and up to nr
events from the completion queue of the AIO context specified by
ctx_id. timeout specifies the amount of time to wait for events, where
a NULL timeout waits until at least min_nr events have been seen. Note
that timeout is relative and will be updated if not NULL and the opera-
tion blocks.
RETURN VALUE
On success, io_getevents() returns the number of events read: 0 if no
events are available, or less than min_nr if the timeout has elapsed.
For the failure return, see NOTES.
ERRORS
EFAULT Either events or timeout is an invalid pointer.
EINVAL ctx_id is invalid. min_nr is out of range or nr is out of
range.
EINTR Interrupted by a signal handler; see signal(7).
ENOSYS io_getevents() is not implemented on this architecture.
VERSIONS
The asynchronous I/O system calls first appeared in Linux 2.5, August
2002.
CONFORMING TO
io_getevents() is Linux-specific and should not be used in programs
that are intended to be portable.
NOTES
Glibc does not provide a wrapper function for this system call.
The wrapper provided in libaio for io_getevents() does not follow the
usual C library conventions for indicating error: on error it returns a
negated error number (the negative of one of the values listed in
ERRORS). If the system call is invoked via syscall(2), then the return
value follows the usual conventions for indicating an error: -1, with
errno set to a (positive) value that indicates the error.
SEE ALSO
io_cancel(2), io_destroy(2), io_setup(2), io_submit(2), time(7)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2008-07-04 IO_GETEVENTS(2)