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 .TH IO_SUBMIT 2 2012-05-08 "Linux" "Linux Programmer's Manual"
7 io_submit \- submit asynchronous I/O blocks for processing
10 .BR "#include <linux/aio_abi.h>" " /* Defines needed types */"
12 .BI "int io_submit(aio_context_t " ctx_id ", long " nr \
13 ", struct iocb **" iocbpp );
20 queues \fInr\fP I/O request blocks for processing in
21 the AIO context \fIctx_id\fP.
24 argument should be an array of \fInr\fP AIO control blocks,
25 which will be submitted to context \fIctx_id\fP.
29 returns the number of \fIiocb\fPs submitted (which may be
30 0 if \fInr\fP is zero).
31 For the failure return, see NOTES.
35 Insufficient resources are available to queue any \fIiocb\fPs.
38 The file descriptor specified in the first \fIiocb\fP is invalid.
41 One of the data structures points to invalid data.
44 The AIO context specified by \fIctx_id\fP is invalid.
45 \fInr\fP is less than 0.
48 is not properly initialized,
49 or the operation specified is invalid for the file descriptor
54 is not implemented on this architecture.
57 The asynchronous I/O system calls first appeared in Linux 2.5.
61 is Linux-specific and should not be used in
62 programs that are intended to be portable.
64 Glibc does not provide a wrapper function for this system call.
65 You could invoke it using
67 But instead, you probably want to use the
69 wrapper function provided by
70 .\" http://git.fedorahosted.org/git/?p=libaio.git
75 wrapper function uses a different type
77 .\" But glibc is confused, since <libaio.h> uses 'io_context_t' to declare
84 wrapper does not follow the usual C library conventions for indicating errors:
85 on error it returns a negated error number
86 (the negative of one of the values listed in ERRORS).
87 If the system call is invoked via
89 then the return value follows the usual conventions for
90 indicating an error: \-1, with
92 set to a (positive) value that indicates the error.