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 .\" .de Sh \" Subsection
13 .\" .de Sp \" Vertical space (when we can't use .PP)
17 .\" .de Ip \" List item
19 .\" .ie \\n(.$>=3 .ne \\$3
23 .TH "IO_SETUP" 2 "2003-02-21" "Linux 2.4" "Linux Programmer's Manual"
25 io_setup \- create an asynchronous I/O context
30 .B #include <libaio.h>
31 .\" #include <linux/aio.h>
34 .BI "int io_setup(unsigned " nr_events ", aio_context_t *" ctxp );
40 \fBio_setup\fR() creates an asynchronous I/O context capable of receiving
41 at least \fInr_events\fR.
42 \fIctxp\fR must not point to an AIO context that already exists, and must
43 be initialized to 0 prior to the call.
44 On successful creation of the AIO context, \fI*ctxp\fR is filled in
45 with the resulting handle.
48 \fBio_setup\fR() returns 0 on success;
49 on failure, it returns one of the errors listed under ERRORS.
53 \fIctxp\fR is not initialized, or the specified \fInr_events\fR
54 exceeds internal limits. \fInr_events\fR should be greater than 0.
57 An invalid pointer is passed for \fIctxp\fR.
60 Insufficient kernel resources are available.
63 The specified \fInr_events\fR exceeds the user's limit of available events.
66 \fBio_setup\fR() is not implemented on this architecture.
69 \fBio_setup\fR() is Linux specific and should not be used in programs
70 that are intended to be portable.
73 The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
76 \fBio_destroy\fR(2), \fBio_getevents\fR(2), \fBio_submit\fR(2),
80 .\" The asynchronous I/O system calls were written by Benjamin LaHaise.