man-pages/man2/io_submit.2

109 lines
2.7 KiB
Groff
Raw Normal View History

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.
.\"
.\" .de Sh \" Subsection
.\" .br
.\" .if t .Sp
.\" .ne 5
.\" .PP
2007-07-18 20:24:30 +00:00
.\" \fB\\$1\fP
.\" .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
.\" ..
.TH IO_SUBMIT 2 2008-06-18 "Linux" "Linux Programmer's Manual"
2004-11-03 13:51:07 +00:00
.SH NAME
io_submit \- submit asynchronous I/O blocks for processing
2004-11-03 13:51:07 +00:00
.SH "SYNOPSIS"
.nf
.\" .ad l
.\" .hy 0
.B #include <libaio.h>
.\" #include <linux/aio.h>
2004-11-03 13:51:07 +00:00
.sp
.\" .HP 16
.BI "int io_submit(aio_context_t " ctx_id ", long " nr \
", struct iocb **" iocbpp );
.\" .ad
.\" .hy
.sp
2007-07-21 05:25:03 +00:00
Link with \fI\-laio\fP.
.fi
2004-11-03 13:51:07 +00:00
.SH "DESCRIPTION"
.PP
.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.
\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"
On success,
.BR io_submit ()
2007-07-18 20:24:30 +00:00
returns the number of \fIiocb\fPs submitted (which may be
0 if \fInr\fP is zero).
For the failure return, see NOTES.
2004-11-03 13:51:07 +00:00
.SH "ERRORS"
.TP
.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
.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
.B ENOSYS
.BR io_submit ()
is not implemented on this architecture.
.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
.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.
.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"
.BR io_cancel (2),
.BR io_destroy (2),
2008-06-23 06:00:09 +00:00
.BR io_getevents (2),
.BR io_setup (2)
.\" .SH "NOTES"
.\" .PP
.\" The asynchronous I/O system calls were written by Benjamin LaHaise.
.\" .SH AUTHOR
.\" Kent Yoder.