1IO_SUBMIT(2) Linux Programmer's Manual IO_SUBMIT(2)
2
3
4
6 io_submit - submit asynchronous I/O blocks for processing
7
9 #include <linux/aio_abi.h> /* Defines needed types */
10
11 int io_submit(aio_context_t ctx_id, long nr, struct iocb **iocbpp);
12
13 Note: There is no glibc wrapper for this system call; see NOTES.
14
16 The io_submit() system call queues nr I/O request blocks for processing
17 in the AIO context ctx_id. The iocbpp argument should be an array of
18 nr AIO control blocks, which will be submitted to context ctx_id.
19
21 On success, io_submit() returns the number of iocbs submitted (which
22 may be 0 if nr is zero). For the failure return, see NOTES.
23
25 EAGAIN Insufficient resources are available to queue any iocbs.
26
27 EBADF The file descriptor specified in the first iocb is invalid.
28
29 EFAULT One of the data structures points to invalid data.
30
31 EINVAL The AIO context specified by ctx_id is invalid. nr is less than
32 0. The iocb at *iocbpp[0] is not properly initialized, or the
33 operation specified is invalid for the file descriptor in the
34 iocb.
35
36 ENOSYS io_submit() is not implemented on this architecture.
37
39 The asynchronous I/O system calls first appeared in Linux 2.5.
40
42 io_submit() is Linux-specific and should not be used in programs that
43 are intended to be portable.
44
46 Glibc does not provide a wrapper function for this system call. You
47 could invoke it using syscall(2). But instead, you probably want to
48 use the io_submit() wrapper function provided by libaio.
49
50 Note that the libaio wrapper function uses a different type (io_con‐
51 text_t) for the ctx_id argument. Note also that the libaio wrapper
52 does not follow the usual C library conventions for indicating errors:
53 on error it returns a negated error number (the negative of one of the
54 values listed in ERRORS). If the system call is invoked via
55 syscall(2), then the return value follows the usual conventions for
56 indicating an error: -1, with errno set to a (positive) value that
57 indicates the error.
58
60 io_cancel(2), io_destroy(2), io_getevents(2), io_setup(2), aio(7)
61
63 This page is part of release 3.53 of the Linux man-pages project. A
64 description of the project, and information about reporting bugs, can
65 be found at http://www.kernel.org/doc/man-pages/.
66
67
68
69Linux 2012-07-13 IO_SUBMIT(2)