io_submitのヘルプ・マニュアル
日本語 英語
io_submit --help
man io_submit
IO_SUBMIT(2) Linux Programmer’s Manual IO_SUBMIT(2)
名前
io_submit - 非同期 I/O ブロックを処理待ちキューに登録する
書式
#include
int io_submit(aio_context_t ctx_id, long nr, struct iocb **iocbpp);
-laio とリンクする。
説明
io_submit() は、AIO コンテキスト ctx_id に nr 個の I/O リクエストを処理
待ちとしてキューに追加する。 iocbpp は、AIO コンテキスト ctx_id に登 録
される nr 個の AIO 制御ブロックの配列になっていなければならない。
返り値
成功すると、 io_submit() は登録した iocb の個数を返す (nr が 0 の場合は
0 を返す)。失敗時の返り値については、「注意」の節を参照すること。
エラー
EAGAIN 何個かの iocb をキューに入れるのに必要なリソースが得られない。
EBADF 先頭の iocb に指定されたファイル・ディスクリプタが無効である。
EFAULT データ構造の中に無効なデータを指しているものがある。
EINVAL ctx_id で指定された aio_context が無効である。 nr が 0 未満で あ
る。 *iocbpp[0] の iocb が適切に初期化されていないか、指定された
操作がその iocb 中のファイル・ディスクリプタに対して無効である。
ENOSYS io_submit() はこのアーキテクチャでは実装されていない。
バージョン
非同期 I/O システム・コールは 2002年8月に Linux 2.5 で初めて登場した。
準拠
io_submit() は Linux 固有であり、移植を想定したプログラムで使用すべきで
はない。
注意
glibc はこのシステムコール用のラッパー関数を提供していない。
libaio で io_submit() 用に提供されているラッパー関数は、エラーの通知 が
通常の C ライブラリの慣習にしたがっておらず、エラーの場合には負のエラー
番号 (エラーの節に列挙されている値の一つを負にしたもの) が返り値とな る
。 syscall(2) 経由でシステムコールを起動すると、返り値は通常のエラー通
知の慣習にしたがってものとなり、エラーの場合には -1 が返り、 errno にエ
ラーを示す (正の) 値が設定される。
関連項目
io_cancel(2), io_destroy(2), io_getevents(2), io_setup(2)
Linux 2008-06-18 IO_SUBMIT(2)
IO_SUBMIT(2) Linux Programmer’s Manual IO_SUBMIT(2)
NAME
io_submit - submit asynchronous I/O blocks for processing
SYNOPSIS
#include
int io_submit(aio_context_t ctx_id, long nr, struct iocb **iocbpp);
Link with -laio.
DESCRIPTION
io_submit() queues nr I/O request blocks for processing in the AIO con-
text ctx_id. iocbpp should be an array of nr AIO control blocks, which
will be submitted to context ctx_id.
RETURN VALUE
On success, io_submit() returns the number of iocbs submitted (which
may be 0 if nr is zero). For the failure return, see NOTES.
ERRORS
EAGAIN Insufficient resources are available to queue any iocbs.
EBADF The file descriptor specified in the first iocb is invalid.
EFAULT One of the data structures points to invalid data.
EINVAL The aio_context specified by ctx_id is invalid. nr is less than
0. The iocb at *iocbpp[0] is not properly initialized, or the
operation specified is invalid for the file descriptor in the
iocb.
ENOSYS io_submit() is not implemented on this architecture.
VERSIONS
The asynchronous I/O system calls first appeared in Linux 2.5, August
2002.
CONFORMING TO
io_submit() 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_submit() 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_getevents(2), io_setup(2)
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-06-18 IO_SUBMIT(2)