1IO_SETUP(2) Linux Programmer's Manual IO_SETUP(2)
2
3
4
6 io_setup - create an asynchronous I/O context
7
9 #include <libaio.h>
10
11 int io_setup(unsigned nr_events, aio_context_t *ctxp);
12
13 Link with -laio.
14
16 io_setup() creates an asynchronous I/O context capable of receiving at
17 least nr_events. ctxp must not point to an AIO context that already
18 exists, and must be initialized to 0 prior to the call. On successful
19 creation of the AIO context, *ctxp is filled in with the resulting han‐
20 dle.
21
23 On success, io_setup() returns 0. For the failure return, see NOTES.
24
26 EAGAIN The specified nr_events exceeds the user's limit of available
27 events.
28
29 EFAULT An invalid pointer is passed for ctxp.
30
31 EINVAL ctxp is not initialized, or the specified nr_events exceeds
32 internal limits. nr_events should be greater than 0.
33
34 ENOMEM Insufficient kernel resources are available.
35
36 ENOSYS io_setup() is not implemented on this architecture.
37
39 The asynchronous I/O system calls first appeared in Linux 2.5, August
40 2002.
41
43 io_setup() is Linux-specific and should not be used in programs that
44 are intended to be portable.
45
47 Glibc does not provide a wrapper function for this system call.
48
49 The wrapper provided in libaio for io_setup() does not follow the usual
50 C library conventions for indicating error: on error it returns a
51 negated error number (the negative of one of the values listed in
52 ERRORS). If the system call is invoked via syscall(2), then the return
53 value follows the usual conventions for indicating an error: -1, with
54 errno set to a (positive) value that indicates the error.
55
57 io_cancel(2), io_destroy(2), io_getevents(2), io_submit(2)
58
60 This page is part of release 3.25 of the Linux man-pages project. A
61 description of the project, and information about reporting bugs, can
62 be found at http://www.kernel.org/doc/man-pages/.
63
64
65
66Linux 2008-06-18 IO_SETUP(2)