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_SUBMIT 2 2008-06-18 "Linux" "Linux Programmer's Manual"
25 io_submit \- submit asynchronous I/O blocks for processing
30 .B #include <libaio.h>
31 .\" #include <linux/aio.h>
34 .BI "int io_submit(aio_context_t " ctx_id ", long " nr \
35 ", struct iocb **" iocbpp );
39 Link with \fI\-laio\fP.
44 queues \fInr\fP I/O request blocks for processing in
45 the AIO context \fIctx_id\fP.
46 \fIiocbpp\fP should be an array of \fInr\fP AIO control blocks,
47 which will be submitted to context \fIctx_id\fP.
51 returns the number of \fIiocb\fPs submitted (which may be
52 0 if \fInr\fP is zero).
53 For the failure return, see NOTES.
57 Insufficient resources are available to queue any \fIiocb\fPs.
60 The file descriptor specified in the first \fIiocb\fP is invalid.
63 One of the data structures points to invalid data.
66 The \fIaio_context\fP specified by \fIctx_id\fP is invalid.
67 \fInr\fP is less than 0.
68 The \fIiocb\fP at *iocbpp[0] is not properly initialized,
69 or the operation specified is invalid for the file descriptor
74 is not implemented on this architecture.
77 The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
81 is Linux-specific and should not be used in
82 programs that are intended to be portable.
84 Glibc does not provide a wrapper function for this system call.
86 The wrapper provided in
90 does not follow the usual C library conventions for indicating error:
91 on error it returns a negated error number
92 (the negative of one of the values listed in ERRORS).
93 If the system call is invoked via
95 then the return value follows the usual conventions for
96 indicating an error: \-1, with
98 set to a (positive) value that indicates the error.
102 .BR io_getevents (2),
106 .\" The asynchronous I/O system calls were written by Benjamin LaHaise.