io_setupのヘルプ・マニュアル
日本語 英語
io_setup --help
man io_setup
IO_SETUP(2) Linux Programmer’s Manual IO_SETUP(2)
名前
io_setup - 非同期 I/O コンテキストを作成する
書式
#include
int io_setup(unsigned nr_events, aio_context_t *ctxp);
-laio とリンクする。
説明
io_setup() は、少なくとも nr_events 個のイベントを受信可能な非同期 I/O
(AIO) コンテキストの作成を行う。 ctxp は、すでに存在する AIO コンテキス
トを指していてはならず、 io_setup() の呼び出しの前に 0 に初期化されてい
なければならない。 AIO コンテキストの作成に成功すると、*ctxp に作成され
た AIO コンテキストへのポインタがセットされる。
返り値
成功した場合、 io_setup() は 0 を返す。失敗時の返り値については、「注意
」の節を参照すること。
エラー
EAGAIN 指定された nr_events がユーザが使用できるイベント数の上限を越 え
ている。
EFAULT ctxp に無効なポインタが指定されている。
EINVAL ctxp が初期化されていないか、指定された nr_events が内部の制限値
を越えている。また、 nr_events は 0 より大きい値に設定すべきであ
る。
ENOMEM 必要なカーネル・リソースを得られない。
ENOSYS io_setup() がこのアーキテクチャでは実装されていない。
バージョン
非同期 I/O システム・コールは 2002年8月に Linux 2.5 で初めて登場した。
準拠
io_setup() は Linux 固有であり、移植を想定したプログラムで使用すべきで
はない。
注意
glibc はこのシステムコール用のラッパー関数を提供していない。
libaio で io_setup() 用に提供されているラッパー関数は、エラーの通知が通
常の C ライブラリの慣習にしたがっておらず、エラーの場合には負のエラー番
号 (エラーの節に列挙されている値の一つを負にしたもの) が返り値となる 。
syscall(2) 経由でシステムコールを起動すると、返り値は通常のエラー通知の
慣習にしたがってものとなり、エラーの場合には -1 が返り、 errno にエラー
を示す (正の) 値が設定される。
関連項目
io_cancel(2), io_destroy(2), io_getevents(2), io_submit(2)
Linux 2003-06-18 IO_SETUP(2)
IO_SETUP(2) Linux Programmer’s Manual IO_SETUP(2)
NAME
io_setup - create an asynchronous I/O context
SYNOPSIS
#include
int io_setup(unsigned nr_events, aio_context_t *ctxp);
Link with -laio.
DESCRIPTION
io_setup() creates an asynchronous I/O context capable of receiving at
least nr_events. ctxp must not point to an AIO context that already
exists, and must be initialized to 0 prior to the call. On successful
creation of the AIO context, *ctxp is filled in with the resulting han-
dle.
RETURN VALUE
On success, io_setup() returns 0. For the failure return, see NOTES.
ERRORS
EAGAIN The specified nr_events exceeds the user’s limit of available
events.
EFAULT An invalid pointer is passed for ctxp.
EINVAL ctxp is not initialized, or the specified nr_events exceeds
internal limits. nr_events should be greater than 0.
ENOMEM Insufficient kernel resources are available.
ENOSYS io_setup() is not implemented on this architecture.
VERSIONS
The asynchronous I/O system calls first appeared in Linux 2.5, August
2002.
CONFORMING TO
io_setup() 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_setup() 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_submit(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_SETUP(2)