]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/io_submit.2
Add "Link with -laio" to SYNOPSIS.
[thirdparty/man-pages.git] / man2 / io_submit.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_SUBMIT 2 2003-02-21 "Linux" "Linux Programmer's Manual"
24 .SH NAME
25 io_submit \- submit asynchronous I/O blocks for processing
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 16
34 .BI "int io_submit(aio_context_t " ctx_id ", long " nr \
35 ", struct iocb **" iocbpp );
36 .\" .ad
37 .\" .hy
38 .sp
39 Link with \fI-laio\fP.
40 .fi
41 .SH "DESCRIPTION"
42 .PP
43 .BR io_submit ()
44 queues \fInr\fR I/O request blocks for processing in
45 the AIO context \fIctx_id\fR. \fIiocbpp\fR should be an array of
46 \fInr\fR AIO request blocks,
47 which will be submitted to context \fIctx_id\fR.
48 .SH "RETURN VALUE"
49 .PP
50 On success,
51 .BR io_submit ()
52 returns the number of \fIiocb\fRs submitted (which may be
53 0 if \fInr\fR is zero);
54 on failure, it returns one of the errors listed under ERRORS.
55 .SH "ERRORS"
56 .TP
57 .B EINVAL
58 The \fIaio_context\fR specified by \fIctx_id\fR is invalid.
59 \fInr\fR is less than 0.
60 The \fIiocb\fR at *iocbpp[0] is not properly initialized,
61 or the operation specified is invalid for the file descriptor
62 in the \fIiocb\fR.
63 .TP
64 .B EFAULT
65 One of the data structures points to invalid data.
66 .TP
67 .B EBADF
68 The file descriptor specified in the first \fIiocb\fR is invalid.
69 .TP
70 .B EAGAIN
71 Insufficient resources are available to queue any \fIiocb\fRs.
72 .TP
73 .B ENOSYS
74 .BR io_submit ()
75 is not implemented on this architecture.
76 .SH "VERSIONS"
77 .PP
78 The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
79 .SH "CONFORMING TO"
80 .PP
81 .BR io_submit ()
82 is Linux specific and should not be used in
83 programs that are intended to be portable.
84 .SH "SEE ALSO"
85 .PP
86 .BR io_setup (2),
87 .BR io_destroy (2),
88 .BR io_getevents (2),
89 .BR io_cancel (2)
90 .\" .SH "NOTES"
91 .\" .PP
92 .\" The asynchronous I/O system calls were written by Benjamin LaHaise.
93 .\" .SH AUTHOR
94 .\" Kent Yoder.