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_SUBMIT 2 2017-09-15 "Linux" "Linux Programmer's Manual"
9 io_submit \- submit asynchronous I/O blocks for processing
12 .BR "#include <linux/aio_abi.h>" " /* Defines needed types */"
14 .BI "int io_submit(aio_context_t " ctx_id ", long " nr \
15 ", struct iocb **" iocbpp );
19 There is no glibc wrapper for this system call; see NOTES.
25 queues \fInr\fP I/O request blocks for processing in
26 the AIO context \fIctx_id\fP.
29 argument should be an array of \fInr\fP AIO control blocks,
30 which will be submitted to context \fIctx_id\fP.
33 (I/O control block) structure defined in linux/aio_abi.h
34 defines the parameters that control the I/O operation.
39 #include <linux/aio_abi.h>
43 __u32 PADDED(aio_key, aio_rw_flags);
61 The fields of this structure are as follows:
64 This is a internal field used by the kernel. Do not modify this field after an
69 This is a internal field used by the kernel. Do not modify this field after an
74 This defines the R/W flags passed with structure. The valid values are:
78 High priority request, poll if possible
81 Write operation complete according to requirement of synchronized I/O data integrity. Similar to a file passed
87 Write operation complete according to requirement of synchronized I/O file integrity. Similar to a file passed
93 Don't wait if the I/O will block for operations such as file block allocations,
94 dirty page flush, mutex locks, or a congested block device inside the kernel.
95 If any of these conditions are met, the control block is returned immediately
96 with a return value of
98 in the res field of the io_event structure.
102 This defines the type of I/O to be performed by the iocb structure. The
103 valid values are defined by the enum defined in linux/aio_abi.h:
113 IOCB_CMD_PWRITEV = 8,
119 This defines the requests priority.
122 The file descriptor on which the I/O operation is to be performed.
125 This is the buffer used to transfer data for a read or write operation.
128 This is the size of the buffer pointed to by
132 This is the file offset at which the I/O operation is to be performed.
135 This is the flag to be passed iocb structure. The only valid value is
137 , which indicates that the asynchronous I/O control must signal the file
138 descriptor mentioned in
143 The file descriptor to signal in the event of asynchronous I/O completion.
148 returns the number of \fIiocb\fPs submitted (which may be
149 less than \fInr\fP, or 0 if \fInr\fP is zero).
150 For the failure return, see NOTES.
154 Insufficient resources are available to queue any \fIiocb\fPs.
157 The file descriptor specified in the first \fIiocb\fP is invalid.
160 One of the data structures points to invalid data.
163 The AIO context specified by \fIctx_id\fP is invalid.
164 \fInr\fP is less than 0.
167 is not properly initialized,
168 or the operation specified is invalid for the file descriptor
173 is not implemented on this architecture.
176 The asynchronous I/O system calls first appeared in Linux 2.5.
180 is Linux-specific and should not be used in
181 programs that are intended to be portable.
183 Glibc does not provide a wrapper function for this system call.
184 You could invoke it using
186 But instead, you probably want to use the
188 wrapper function provided by
189 .\" http://git.fedorahosted.org/git/?p=libaio.git
194 wrapper function uses a different type
196 .\" But glibc is confused, since <libaio.h> uses 'io_context_t' to declare
203 wrapper does not follow the usual C library conventions for indicating errors:
204 on error it returns a negated error number
205 (the negative of one of the values listed in ERRORS).
206 If the system call is invoked via
208 then the return value follows the usual conventions for
209 indicating an error: \-1, with
211 set to a (positive) value that indicates the error.
215 .BR io_getevents (2),