2004-11-03 13:51:07 +00:00
|
|
|
.\" Copyright (C) 2003 Free Software Foundation, Inc.
|
|
|
|
.\" This file is distributed according to the GNU General Public License.
|
|
|
|
.\" See the file COPYING in the top level source directory for details.
|
|
|
|
.\"
|
2007-04-03 12:47:21 +00:00
|
|
|
.\" .de Sh \" Subsection
|
|
|
|
.\" .br
|
|
|
|
.\" .if t .Sp
|
|
|
|
.\" .ne 5
|
|
|
|
.\" .PP
|
2007-07-18 20:24:30 +00:00
|
|
|
.\" \fB\\$1\fP
|
2007-04-03 12:47:21 +00:00
|
|
|
.\" .PP
|
|
|
|
.\" ..
|
|
|
|
.\" .de Sp \" Vertical space (when we can't use .PP)
|
|
|
|
.\" .if t .sp .5v
|
|
|
|
.\" .if n .sp
|
|
|
|
.\" ..
|
|
|
|
.\" .de Ip \" List item
|
|
|
|
.\" .br
|
|
|
|
.\" .ie \\n(.$>=3 .ne \\$3
|
|
|
|
.\" .el .ne 3
|
|
|
|
.\" .IP "\\$1" \\$2
|
|
|
|
.\" ..
|
2008-06-18 20:24:08 +00:00
|
|
|
.TH IO_SUBMIT 2 2008-06-18 "Linux" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
2007-04-03 12:47:21 +00:00
|
|
|
io_submit \- submit asynchronous I/O blocks for processing
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "SYNOPSIS"
|
2007-04-03 12:47:21 +00:00
|
|
|
.nf
|
|
|
|
.\" .ad l
|
|
|
|
.\" .hy 0
|
2007-06-15 05:47:08 +00:00
|
|
|
.B #include <libaio.h>
|
|
|
|
.\" #include <linux/aio.h>
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
2007-04-03 12:47:21 +00:00
|
|
|
.\" .HP 16
|
|
|
|
.BI "int io_submit(aio_context_t " ctx_id ", long " nr \
|
|
|
|
", struct iocb **" iocbpp );
|
|
|
|
.\" .ad
|
|
|
|
.\" .hy
|
2007-06-15 05:47:08 +00:00
|
|
|
.sp
|
2007-07-21 05:25:03 +00:00
|
|
|
Link with \fI\-laio\fP.
|
2007-04-03 12:47:21 +00:00
|
|
|
.fi
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "DESCRIPTION"
|
|
|
|
.PP
|
2007-05-12 09:06:04 +00:00
|
|
|
.BR io_submit ()
|
2007-07-18 20:24:30 +00:00
|
|
|
queues \fInr\fP I/O request blocks for processing in
|
|
|
|
the AIO context \fIctx_id\fP.
|
2008-09-18 12:30:46 +00:00
|
|
|
\fIiocbpp\fP should be an array of \fInr\fP AIO control blocks,
|
2007-07-18 20:24:30 +00:00
|
|
|
which will be submitted to context \fIctx_id\fP.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "RETURN VALUE"
|
2007-04-12 22:42:49 +00:00
|
|
|
On success,
|
2007-05-12 09:06:04 +00:00
|
|
|
.BR io_submit ()
|
2007-07-18 20:24:30 +00:00
|
|
|
returns the number of \fIiocb\fPs submitted (which may be
|
2008-06-18 20:24:08 +00:00
|
|
|
0 if \fInr\fP is zero).
|
|
|
|
For the failure return, see NOTES.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "ERRORS"
|
|
|
|
.TP
|
2008-06-11 13:57:31 +00:00
|
|
|
.B EAGAIN
|
|
|
|
Insufficient resources are available to queue any \fIiocb\fPs.
|
|
|
|
.TP
|
|
|
|
.B EBADF
|
|
|
|
The file descriptor specified in the first \fIiocb\fP is invalid.
|
|
|
|
.TP
|
|
|
|
.B EFAULT
|
|
|
|
One of the data structures points to invalid data.
|
|
|
|
.TP
|
2007-04-03 12:47:21 +00:00
|
|
|
.B EINVAL
|
2007-07-18 20:24:30 +00:00
|
|
|
The \fIaio_context\fP specified by \fIctx_id\fP is invalid.
|
|
|
|
\fInr\fP is less than 0.
|
|
|
|
The \fIiocb\fP at *iocbpp[0] is not properly initialized,
|
2007-06-08 03:17:37 +00:00
|
|
|
or the operation specified is invalid for the file descriptor
|
2007-07-18 20:24:30 +00:00
|
|
|
in the \fIiocb\fP.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2007-04-03 12:47:21 +00:00
|
|
|
.B ENOSYS
|
2007-05-12 09:06:04 +00:00
|
|
|
.BR io_submit ()
|
|
|
|
is not implemented on this architecture.
|
2007-05-18 16:06:42 +00:00
|
|
|
.SH "VERSIONS"
|
|
|
|
.PP
|
|
|
|
The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "CONFORMING TO"
|
|
|
|
.PP
|
2007-05-12 09:06:04 +00:00
|
|
|
.BR io_submit ()
|
2007-12-25 21:28:09 +00:00
|
|
|
is Linux-specific and should not be used in
|
2006-12-17 01:34:44 +00:00
|
|
|
programs that are intended to be portable.
|
2008-06-18 20:24:08 +00:00
|
|
|
.SH NOTES
|
|
|
|
Glibc does not provide a wrapper function for this system call.
|
|
|
|
|
|
|
|
The wrapper provided in
|
|
|
|
.I libaio
|
|
|
|
for
|
|
|
|
.BR io_submit ()
|
|
|
|
does not follow the usual C library conventions for indicating error:
|
|
|
|
on error it returns a negated error number
|
|
|
|
(the negative of one of the values listed in ERRORS).
|
|
|
|
If the system call is invoked via
|
|
|
|
.BR syscall (2),
|
|
|
|
then the return value follows the usual conventions for
|
|
|
|
indicating an error: \-1, with
|
|
|
|
.I errno
|
|
|
|
set to a (positive) value that indicates the error.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "SEE ALSO"
|
2008-06-11 13:57:31 +00:00
|
|
|
.BR io_cancel (2),
|
2007-05-12 09:06:04 +00:00
|
|
|
.BR io_destroy (2),
|
2008-06-23 06:00:09 +00:00
|
|
|
.BR io_getevents (2),
|
2010-10-03 04:36:31 +00:00
|
|
|
.BR io_setup (2),
|
|
|
|
.BR aio (7)
|
2007-04-03 12:47:21 +00:00
|
|
|
.\" .SH "NOTES"
|
|
|
|
.\" .PP
|
|
|
|
.\" The asynchronous I/O system calls were written by Benjamin LaHaise.
|
|
|
|
.\" .SH AUTHOR
|
|
|
|
.\" Kent Yoder.
|