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 2008-06-18 "Linux" "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 );
38 Link with \fI\-laio\fP.
43 creates an asynchronous I/O context capable of receiving
44 at least \fInr_events\fP.
45 \fIctxp\fP must not point to an AIO context that already exists, and must
46 be initialized to 0 prior to the call.
47 On successful creation of the AIO context, \fI*ctxp\fP is filled in
48 with the resulting handle.
53 For the failure return, see NOTES.
57 The specified \fInr_events\fP exceeds the user's limit of available events.
60 An invalid pointer is passed for \fIctxp\fP.
63 \fIctxp\fP is not initialized, or the specified \fInr_events\fP
64 exceeds internal limits.
65 \fInr_events\fP should be greater than 0.
68 Insufficient kernel resources are available.
72 is not implemented on this architecture.
75 The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
79 is Linux-specific and should not be used in programs
80 that are intended to be portable.
82 Glibc does not provide a wrapper function for this system call.
84 The wrapper provided in
88 does not follow the usual C library conventions for indicating error:
89 on error it returns a negated error number
90 (the negative of one of the values listed in ERRORS).
91 If the system call is invoked via
93 then the return value follows the usual conventions for
94 indicating an error: \-1, with
96 set to a (positive) value that indicates the error.
100 .BR io_getevents (2),
104 .\" The asynchronous I/O system calls were written by Benjamin LaHaise.