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 .\" .de Sh \" Subsection
16 .\" .de Sp \" Vertical space (when we can't use .PP)
20 .\" .de Ip \" List item
22 .\" .ie \\n(.$>=3 .ne \\$3
26 .TH IO_SETUP 2 2003-06-18 "Linux" "Linux Programmer's Manual"
28 .\"O io_setup \- create an asynchronous I/O context
30 io_setup \- 非同期 I/O コンテキストを作成する
36 .B #include <libaio.h>
37 .\" #include <linux/aio.h>
40 .BI "int io_setup(unsigned " nr_events ", aio_context_t *" ctxp );
44 .\"O Link with \fI\-laio\fP.
47 .\"O .SH "DESCRIPTION"
51 .\"O creates an asynchronous I/O context capable of receiving
52 .\"O at least \fInr_events\fP.
54 は、少なくとも \fInr_events\fP 個のイベントを受信可能な
55 非同期 I/O (AIO) コンテキストの作成を行う。
56 .\"O \fIctxp\fP must not point to an AIO context that already exists, and must
57 .\"O be initialized to 0 prior to the call.
58 \fIctxp\fP は、すでに存在する AIO コンテキストを指していてはならず、
60 の呼び出しの前に 0 に初期化されていなければならない。
61 .\"O On successful creation of the AIO context, \fI*ctxp\fP is filled in
62 .\"O with the resulting handle.
63 AIO コンテキストの作成に成功すると、\fI*ctxp\fP に作成された
64 AIO コンテキストへのポインタがセットされる。
65 .\"O .SH "RETURN VALUE"
70 .\"O For the failure return, see NOTES.
74 失敗時の返り値については、「注意」の節を参照すること。
79 .\"O The specified \fInr_events\fP exceeds the user's limit of available events.
80 指定された \fInr_events\fP がユーザが使用できるイベント数の上限を越えている。
83 .\"O An invalid pointer is passed for \fIctxp\fP.
84 \fIctxp\fP に無効なポインタが指定されている。
87 .\"O \fIctxp\fP is not initialized, or the specified \fInr_events\fP
88 .\"O exceeds internal limits.
89 .\"O \fInr_events\fP should be greater than 0.
90 \fIctxp\fP が初期化されていないか、指定された \fInr_events\fP が
91 内部の制限値を越えている。また、 \fInr_events\fP は 0 より大きい値に
95 .\"O Insufficient kernel resources are available.
100 .\"O is not implemented on this architecture.
102 がこのアーキテクチャでは実装されていない。
106 .\"O The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
107 非同期 I/O システム・コールは 2002年8月に Linux 2.5 で初めて登場した。
108 .\"O .SH "CONFORMING TO"
112 .\"O is Linux-specific and should not be used in programs
113 .\"O that are intended to be portable.
115 は Linux 固有であり、移植を想定したプログラムで
119 .\"O Glibc does not provide a wrapper function for this system call.
120 glibc はこのシステムコール用のラッパー関数を提供していない。
122 .\"O The wrapper provided in
126 .\"O does not follow the usual C library conventions for indicating error:
127 .\"O on error it returns a negated error number
128 .\"O (the negative of one of the values listed in ERRORS).
129 .\"O If the system call is invoked via
130 .\"O .BR syscall (2),
131 .\"O then the return value follows the usual conventions for
132 .\"O indicating an error: \-1, with
134 .\"O set to a (positive) value that indicates the error.
138 用に提供されているラッパー関数は、エラーの通知が通常の C ライブラリの
139 慣習にしたがっておらず、エラーの場合には負のエラー番号
140 (エラーの節に列挙されている値の一つを負にしたもの) が返り値となる。
142 経由でシステムコールを起動すると、返り値は通常のエラー通知の慣習に
143 したがってものとなり、エラーの場合には \-1 が返り、
145 にエラーを示す (正の) 値が設定される。
151 .BR io_getevents (2),
157 .\"O .\" The asynchronous I/O system calls were written by Benjamin LaHaise.
158 .\" 非同期 I/O システム・コールは Benjamin LaHaise が書いた。