]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/io_setup.2
Wrapped long lines, wrapped at sentence boundaries; stripped trailing
[thirdparty/man-pages.git] / man2 / io_setup.2
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.
4 .\"
5 .\" .de Sh \" Subsection
6 .\" .br
7 .\" .if t .Sp
8 .\" .ne 5
9 .\" .PP
10 .\" \fB\\$1\fR
11 .\" .PP
12 .\" ..
13 .\" .de Sp \" Vertical space (when we can't use .PP)
14 .\" .if t .sp .5v
15 .\" .if n .sp
16 .\" ..
17 .\" .de Ip \" List item
18 .\" .br
19 .\" .ie \\n(.$>=3 .ne \\$3
20 .\" .el .ne 3
21 .\" .IP "\\$1" \\$2
22 .\" ..
23 .TH "IO_SETUP" 2 "2003-02-21" "Linux 2.4" "Linux Programmer's Manual"
24 .SH NAME
25 io_setup \- create an asynchronous I/O context
26 .SH "SYNOPSIS"
27 .nf
28 .\" .ad l
29 .\" .hy 0
30 .B #include <libaio.h>
31 .\" #include <linux/aio.h>
32 .sp
33 .\" .HP 15
34 .BI "int io_setup(unsigned " nr_events ", aio_context_t *" ctxp );
35 .\" .ad
36 .\" .hy
37 .fi
38 .SH "DESCRIPTION"
39 .PP
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.
46 .SH "RETURN VALUE"
47 .PP
48 \fBio_setup\fR() returns 0 on success;
49 on failure, it returns one of the errors listed under ERRORS.
50 .SH "ERRORS"
51 .TP
52 .B EINVAL
53 \fIctxp\fR is not initialized, or the specified \fInr_events\fR
54 exceeds internal limits. \fInr_events\fR should be greater than 0.
55 .TP
56 .B EFAULT
57 An invalid pointer is passed for \fIctxp\fR.
58 .TP
59 .B ENOMEM
60 Insufficient kernel resources are available.
61 .TP
62 .B EAGAIN
63 The specified \fInr_events\fR exceeds the user's limit of available events.
64 .TP
65 .B ENOSYS
66 \fBio_setup\fR() is not implemented on this architecture.
67 .SH "CONFORMING TO"
68 .PP
69 \fBio_setup\fR() is Linux specific and should not be used in programs
70 that are intended to be portable.
71 .SH "VERSIONS"
72 .PP
73 The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
74 .SH "SEE ALSO"
75 .PP
76 \fBio_destroy\fR(2), \fBio_getevents\fR(2), \fBio_submit\fR(2),
77 \fBio_cancel\fR(2).
78 .\" .SH "NOTES"
79 .\" .PP
80 .\" The asynchronous I/O system calls were written by Benjamin LaHaise.
81 .\" .SH AUTHOR
82 .\" Kent Yoder.