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.
|
|
|
|
.\"
|
get_robust_list.2, get_thread_area.2, getcpu.2, getdents.2, gettid.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2, ioprio_set.2, kexec_load.2, llseek.2, modify_ldt.2, mq_getsetattr.2, pivot_root.2, readdir.2, rt_sigqueueinfo.2, set_thread_area.2, sgetmask.2, spu_create.2, spu_run.2, subpage_prot.2, sysctl.2, tkill.2: Add note to SYNOPSIS that there is no glibc wrapper for system call
Reduce the chance that the reader may be misled into thinking
that there is a wrapper function for this system call by noting
explicitly in the SYNOPSIS that there is no glibc wrapper and
pointing the reader to NOTES for further details.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-07-13 06:48:20 +00:00
|
|
|
.TH IO_SUBMIT 2 2012-07-13 "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
|
2012-05-08 02:41:17 +00:00
|
|
|
.BR "#include <linux/aio_abi.h>" " /* Defines needed types */"
|
|
|
|
|
2007-04-03 12:47:21 +00:00
|
|
|
.BI "int io_submit(aio_context_t " ctx_id ", long " nr \
|
|
|
|
", struct iocb **" iocbpp );
|
|
|
|
.fi
|
get_robust_list.2, get_thread_area.2, getcpu.2, getdents.2, gettid.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2, ioprio_set.2, kexec_load.2, llseek.2, modify_ldt.2, mq_getsetattr.2, pivot_root.2, readdir.2, rt_sigqueueinfo.2, set_thread_area.2, sgetmask.2, spu_create.2, spu_run.2, subpage_prot.2, sysctl.2, tkill.2: Add note to SYNOPSIS that there is no glibc wrapper for system call
Reduce the chance that the reader may be misled into thinking
that there is a wrapper function for this system call by noting
explicitly in the SYNOPSIS that there is no glibc wrapper and
pointing the reader to NOTES for further details.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-07-13 06:48:20 +00:00
|
|
|
|
|
|
|
.IR Note :
|
|
|
|
There is no glibc wrapper for this system call; see NOTES.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "DESCRIPTION"
|
|
|
|
.PP
|
2012-05-08 02:41:17 +00:00
|
|
|
The
|
2007-05-12 09:06:04 +00:00
|
|
|
.BR io_submit ()
|
2012-05-08 02:41:17 +00:00
|
|
|
system call
|
2007-07-18 20:24:30 +00:00
|
|
|
queues \fInr\fP I/O request blocks for processing in
|
|
|
|
the AIO context \fIctx_id\fP.
|
2012-05-08 02:41:17 +00:00
|
|
|
The
|
|
|
|
.I iocbpp
|
|
|
|
argument 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
|
2012-05-08 02:41:17 +00:00
|
|
|
The AIO context specified by \fIctx_id\fP is invalid.
|
2007-07-18 20:24:30 +00:00
|
|
|
\fInr\fP is less than 0.
|
2012-05-08 02:41:17 +00:00
|
|
|
The \fIiocb\fP at
|
|
|
|
.I *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
|
2012-05-08 02:41:17 +00:00
|
|
|
The asynchronous I/O system calls first appeared in Linux 2.5.
|
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.
|
2012-05-08 02:41:17 +00:00
|
|
|
You could invoke it using
|
|
|
|
.BR syscall (2).
|
|
|
|
But instead, you probably want to use the
|
|
|
|
.BR io_submit ()
|
|
|
|
wrapper function provided by
|
|
|
|
.\" http://git.fedorahosted.org/git/?p=libaio.git
|
|
|
|
.IR libaio .
|
2008-06-18 20:24:08 +00:00
|
|
|
|
2012-05-08 02:41:17 +00:00
|
|
|
Note that the
|
2008-06-18 20:24:08 +00:00
|
|
|
.I libaio
|
2012-05-08 02:41:17 +00:00
|
|
|
wrapper function uses a different type
|
|
|
|
.RI ( io_context_t )
|
|
|
|
.\" But glibc is confused, since <libaio.h> uses 'io_context_t' to declare
|
|
|
|
.\" the system call.
|
|
|
|
for the
|
|
|
|
.I ctx_id
|
|
|
|
argument.
|
|
|
|
Note also that the
|
|
|
|
.I libaio
|
|
|
|
wrapper does not follow the usual C library conventions for indicating errors:
|
2008-06-18 20:24:08 +00:00
|
|
|
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 AUTHOR
|
|
|
|
.\" Kent Yoder.
|