1 .\" Copyright (C) 2003 Free Software Foundation, Inc.
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" This file is distributed according to the GNU General Public License.
7 .TH IO_SETUP 2 2017-09-15 "Linux" "Linux Programmer's Manual"
9 io_setup \- create an asynchronous I/O context
12 .BR "#include <linux/aio_abi.h>" " /* Defines needed types */"
14 .BI "int io_setup(unsigned " nr_events ", aio_context_t *" ctx_idp );
18 There is no glibc wrapper for this system call; see NOTES.
24 creates an asynchronous I/O context suitable for concurrently processing
25 \fInr_events\fP operations.
28 argument must not point to an AIO context that already exists, and must
29 be initialized to 0 prior to the call.
30 On successful creation of the AIO context, \fI*ctx_idp\fP is filled in
31 with the resulting handle.
36 For the failure return, see NOTES.
40 The specified \fInr_events\fP exceeds the user's limit of available events,
42 .IR /proc/sys/fs/aio-max-nr .
45 An invalid pointer is passed for \fIctx_idp\fP.
48 \fIctx_idp\fP is not initialized, or the specified \fInr_events\fP
49 exceeds internal limits.
50 \fInr_events\fP should be greater than 0.
53 Insufficient kernel resources are available.
57 is not implemented on this architecture.
60 The asynchronous I/O system calls first appeared in Linux 2.5.
64 is Linux-specific and should not be used in programs
65 that are intended to be portable.
67 Glibc does not provide a wrapper function for this system call.
68 You could invoke it using
70 But instead, you probably want to use the
72 wrapper function provided by
73 .\" http://git.fedorahosted.org/git/?p=libaio.git
78 wrapper function uses a different type
79 .RI ( "io_context_t\ *" )
80 .\" But glibc is confused, since <libaio.h> uses 'io_context_t' to declare
87 wrapper does not follow the usual C library conventions for indicating errors:
88 on error it returns a negated error number
89 (the negative of one of the values listed in ERRORS).
90 If the system call is invoked via
92 then the return value follows the usual conventions for
93 indicating an error: \-1, with
95 set to a (positive) value that indicates the error.