Formatting fixes + fixed return values.

This commit is contained in:
Michael Kerrisk 2007-04-03 12:47:21 +00:00
parent 2af7f393df
commit d12c14243e
5 changed files with 215 additions and 285 deletions

View File

@ -2,41 +2,42 @@
.\" 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
\fB\\$1\fR
.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
..
.\" .de Sh \" Subsection
.\" .br
.\" .if t .Sp
.\" .ne 5
.\" .PP
.\" \fB\\$1\fR
.\" .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_CANCEL" 2 "2003-02-21" "Linux 2.4" "Linux Programmer's Manual"
.SH NAME
io_cancel \- Cancel an outstanding asynchronous I/O operation
io_cancel \- cancel an outstanding asynchronous I/O operation
.SH "SYNOPSIS"
.ad l
.hy 0
#include <libaio.>
.nf
.\" .ad l
.\" .hy 0
.\"
.B #include <libaio.h>
.\"#include <linux/aio.h>
.sp
.HP 16
int\ \fBio_cancel\fR\ (aio_context_t\ \fIctx_id\fR, struct\ iocb\ \fI*iocb\fR, struct\ io_event\ \fI*result\fR);
.ad
.hy
.\" .HP 16
.BI "int io_cancel(aio_context_t " ctx_id ", struct iocb *" iocb ,
.BI " struct io_event *" result );
.\" .ad
.\" .hy
.fi
.SH "DESCRIPTION"
.PP
\fBio_cancel\fR() attempts to cancel an asynchronous I/O operation
previously submitted with the \fBio_submit\fR system call.
@ -44,52 +45,38 @@ previously submitted with the \fBio_submit\fR system call.
If the AIO context is found, the event will be cancelled and then copied
into the memory pointed to by \fIresult\fR without being placed
into the completion queue.
.SH "RETURN VALUE"
.PP
\fBio_cancel\fR() returns 0 on success; otherwise, it returns one of the
errors listed in the "Errors" section.
\fBio_cancel\fR() returns 0 on success;
on failure, it returns one of the errors listed under ERRORS.
.SH "ERRORS"
.TP
EINVAL
.B EINVAL
The AIO context specified by \fIctx_id\fR is invalid.
.TP
EFAULT
.B EFAULT
One of the data structures points to invalid data.
.TP
EAGAIN
.B EAGAIN
The \fIiocb\fR specified was not cancelled.
.TP
ENOSYS
.B ENOSYS
\fBio_cancel\fR() is not implemented on this architecture.
.SH "VERSIONS"
.PP
The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
.SH "CONFORMING TO"
.PP
\fBio_cancel\fR() is Linux specific and should not be used
in programs that are intended to be portable.
.SH "SEE ALSO"
.PP
\fBio_setup\fR(2), \fBio_destroy\fR(2), \fBio_getevents\fR(2),
\fBio_submit\fR(2).
.SH "NOTES"
.PP
The asynchronous I/O system calls were written by Benjamin LaHaise.
.SH AUTHOR
Kent Yoder.
.\" .SH "NOTES"
.\"
.\" .PP
.\" The asynchronous I/O system calls were written by Benjamin LaHaise.
.\"
.\" .SH AUTHOR
.\" Kent Yoder.

View File

@ -2,87 +2,75 @@
.\" 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
\fB\\$1\fR
.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
..
.\" .de Sh \" Subsection
.\" .br
.\" .if t .Sp
.\" .ne 5
.\" .PP
.\" \fB\\$1\fR
.\" .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_DESTROY" 2 "2003-02-21" "Linux 2.4" "Linux Programmer's Manual"
.SH NAME
io_destroy \- Destroy an asynchronous I/O context
io_destroy \- destroy an asynchronous I/O context
.SH "SYNOPSIS"
.ad l
.hy 0
#include <libaio.h>
.nf
.\" .ad l
.\" .hy 0
.B #include <libaio.h>
.\" #include <linux/aio.h>
.sp
.HP 17
int\ \fBio_destroy\fR\ (aio_context_t\ \fIctx\fR);
.ad
.hy
.\" .HP 17
.BI "int io_destroy(aio_context_t " ctx );
.\" .ad
.\" .hy
.fi
.SH "DESCRIPTION"
.PP
\fBio_destroy\fR() removes the asynchronous I/O context from the list of
I/O contexts and then destroys it.
\fBio_destroy\fR() can also cancel any outstanding asynchronous I/O
actions on \fIctx\fR and block on completion.
.SH "RETURN VALUE"
.PP
\fBio_destroy\fR() returns 0 on success.
\fBio_destroy\fR() returns 0 on success;
on failure, it returns one of the errors listed under ERRORS.
.SH "ERRORS"
.SH "ERRORS"
.TP
EINVAL
.B EINVAL
The AIO context specified by \fIctx\fR is invalid.
.TP
EFAULT
.B EFAULT
The context pointed to is invalid.
.TP
ENOSYS
.B ENOSYS
\fBio_destroy\fR() is not implemented on this architecture.
.SH "CONFORMING TO"
.PP
\fBio_destroy\fR() is Linux specific and should not be used in programs
that are intended to be portable.
.SH "VERSIONS"
.PP
The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
.SH "SEE ALSO"
.PP
\fBio_setup\fR(2), \fBio_submit\fR(2), \fBio_getevents\fR(2),
\fBio_cancel\fR(2).
.SH "NOTES"
.PP
The asynchronous I/O system calls were written by Benjamin LaHaise.
.SH AUTHOR
Kent Yoder.
.\" .SH "NOTES"
.\"
.\" .PP
.\" The asynchronous I/O system calls were written by Benjamin LaHaise.
.\"
.\" .SH AUTHOR
.\" Kent Yoder.

View File

@ -2,97 +2,84 @@
.\" 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
\fB\\$1\fR
.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
..
.\" .de Sh \" Subsection
.\" .br
.\" .if t .Sp
.\" .ne 5
.\" .PP
.\" \fB\\$1\fR
.\" .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_GETEVENTS" 2 "2003-02-21" "Linux 2.4" "Linux Programmer's Manual"
.SH NAME
io_getevents \- Read asynchronous I/O events from the completion queue
io_getevents \- read asynchronous I/O events from the completion queue
.SH "SYNOPSIS"
.ad l
.hy 0
#include <linux/time.h>
.sp
#include <libaio.h>
.nf
.\" .ad l
.\" .hy 0
.B #include <linux/time.h>
.B #include <libaio.h>
.\" #include <linux/aio.h>
.sp
.HP 19
int\ \fBio_getevents\fR\ (aio_context_t\ \fIctx_id\fR, long\ \fImin_nr\fR, long\ \fInr\fR, struct\ io_event\ \fI*events\fR, struct\ timespec\ \fI*timeout\fR);
.ad
.hy
.\" .HP 19
.BI "int io_getevents(aio_context_t " ctx_id ", long " min_nr ", long " nr ,
.BI " struct io_event *" events \
", struct timespec *" timeout );
.\" .ad
.\" .hy
.fi
.SH "DESCRIPTION"
.PP
\fBio_getevents\fR() attempts to read at least \fImin_nr\fR events and
up to \fInr\fR events from the completion queue of the AIO context
specified by \fIctx_id\fR.
\fItimeout\fR specifies the amount of time to wait for events,
where a NULL timeout waits until at least \fImin_nr\fR events have been seen.
where a NULL timeout waits until at least \fImin_nr\fR events
have been seen.
Note that \fItimeout\fR is relative and will be updated if not NULL
and the operation blocks.
.SH "RETURN VALUE"
.PP
On success,
\fBio_getevents\fR() returns the number of events read: 0 if no events are
available or < \fImin_nr\fR if the \fItimeout\fR has elapsed.
available or < \fImin_nr\fR if the \fItimeout\fR has elapsed;
on failure, it returns one of the errors listed under ERRORS.
.SH "ERRORS"
.TP
EINVAL
.B EINVAL
\fIctx_id\fR is invalid. \fImin_nr\fR is out of range or \fInr\fR is
out of range.
.TP
EFAULT
.B EFAULT
Either \fIevents\fR or \fItimeout\fR is an invalid pointer.
.TP
ENOSYS
.B ENOSYS
\fBio_getevents\fR() is not implemented on this architecture.
.SH "CONFORMING TO"
.PP
\fBio_getevents\fR() is Linux specific and should not be used in
programs that are intended to be portable.
.SH "VERSIONS"
.PP
The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
.SH "SEE ALSO"
.PP
\fBio_setup\fR(2), \fBio_submit\fR(2), \fBio_getevents\fR(2),
\fBio_cancel\fR(2), \fBio_destroy\fR(2).
.SH "NOTES"
.PP
The asynchronous I/O system calls were written by Benjamin LaHaise.
.SH AUTHOR
Kent Yoder.
.\" .SH "NOTES"
.\"
.\" .PP
.\" The asynchronous I/O system calls were written by Benjamin LaHaise.
.\"
.\" .SH AUTHOR
.\" Kent Yoder.

View File

@ -2,41 +2,40 @@
.\" 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
\fB\\$1\fR
.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
..
.\" .de Sh \" Subsection
.\" .br
.\" .if t .Sp
.\" .ne 5
.\" .PP
.\" \fB\\$1\fR
.\" .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_SETUP" 2 "2003-02-21" "Linux 2.4" "Linux Programmer's Manual"
.SH NAME
io_setup \- Create an asynchronous I/O context
io_setup \- create an asynchronous I/O context
.SH "SYNOPSIS"
.ad l
.hy 0
#include <libaio.h>
.nf
.\" .ad l
.\" .hy 0
.B #include <libaio.h>
.\" #include <linux/aio.h>
.sp
.HP 15
int\ \fBio_setup\fR\ (unsigned\ \fInr_events\fR, aio_context_t\ \fI*ctxp\fR);
.ad
.hy
.\" .HP 15
.BI "int io_setup(unsigned " nr_events ", aio_context_t *" ctxp );
.\" .ad
.\" .hy
.fi
.SH "DESCRIPTION"
.PP
\fBio_setup\fR() creates an asynchronous I/O context capable of receiving
at least \fInr_events\fR.
@ -44,57 +43,40 @@ at least \fInr_events\fR.
be initialized to 0 prior to the call.
On successful creation of the AIO context, \fI*ctxp\fR is filled in
with the resulting handle.
.SH "RETURN VALUE"
.PP
\fBio_setup\fR() returns 0 on success; otherwise, one of the errors
listed in the "Errors" section is returned.
\fBio_setup\fR() returns 0 on success;
on failure, it returns one of the errors listed under ERRORS.
.SH "ERRORS"
.TP
EINVAL
.B EINVAL
\fIctxp\fR is not initialized, or the specified \fInr_events\fR
exceeds internal limits. \fInr_events\fR should be greater than 0.
.TP
EFAULT
.B EFAULT
An invalid pointer is passed for \fIctxp\fR.
.TP
ENOMEM
.B ENOMEM
Insufficient kernel resources are available.
.TP
EAGAIN
.B EAGAIN
The specified \fInr_events\fR exceeds the user's limit of available events.
.TP
ENOSYS
.B ENOSYS
\fBio_setup\fR() is not implemented on this architecture.
.SH "CONFORMING TO"
.PP
\fBio_setup\fR() is Linux specific and should not be used in programs
that are intended to be portable.
.SH "VERSIONS"
.PP
The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
.SH "SEE ALSO"
.PP
\fBio_destroy\fR(2), \fBio_getevents\fR(2), \fBio_submit\fR(2),
\fBio_cancel\fR(2).
.SH "NOTES"
.PP
The asynchronous I/O system calls were written by Benjamin LaHaise.
.SH AUTHOR
Kent Yoder.
.\" .SH "NOTES"
.\" .PP
.\" The asynchronous I/O system calls were written by Benjamin LaHaise.
.\" .SH AUTHOR
.\" Kent Yoder.

View File

@ -2,97 +2,83 @@
.\" 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
\fB\\$1\fR
.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
..
.\" .de Sh \" Subsection
.\" .br
.\" .if t .Sp
.\" .ne 5
.\" .PP
.\" \fB\\$1\fR
.\" .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 "2003-02-21" "Linux 2.4" "Linux Programmer's Manual"
.SH NAME
io_submit \- Submit asynchronous I/O blocks for processing
io_submit \- submit asynchronous I/O blocks for processing
.SH "SYNOPSIS"
.ad l
.hy 0
#include <linux/aio.h>
.nf
.\" .ad l
.\" .hy 0
.B #include <linux/aio.h>
.sp
.HP 16
int\ \fBio_submit\fR\ (aio_context_t\ \fIctx_id\fR, long\ \fInr\fR, struct\ iocb\ \fI**iocbpp\fR);
.ad
.hy
.\" .HP 16
.BI "int io_submit(aio_context_t " ctx_id ", long " nr \
", struct iocb **" iocbpp );
.\" .ad
.\" .hy
.fi
.SH "DESCRIPTION"
.PP
\fBio_submit\fR() queues \fInr\fR I/O request blocks for processing in
the AIO context \fIctx_id\fR. \fIiocbpp\fR should be an array of
\fInr\fR AIO request blocks, which will be submitted to context \fIctx_id\fR.
\fInr\fR AIO request blocks,
which will be submitted to context \fIctx_id\fR.
.SH "RETURN VALUE"
.PP
\fBio_submit\fR() returns the number of \fIiocb\fRs submitted and
0 if \fInr\fR is zero.
On success,
\fBio_submit\fR() returns the number of \fIiocb\fRs submitted (which may be
0 if \fInr\fR is zero);
on failure, it returns one of the errors listed under ERRORS.
.SH "ERRORS"
.TP
EINVAL
.B EINVAL
The \fIaio_context\fR specified by \fIctx_id\fR is invalid.
\fInr\fR is less than 0. The \fIiocb\fR at *iocbpp[0] is not properly
initialized, or the operation specified is invalid for the file descriptor
in the \fIiocb\fR.
.TP
EFAULT
.B EFAULT
One of the data structures points to invalid data.
.TP
EBADF
.B EBADF
The file descriptor specified in the first \fIiocb\fR is invalid.
.TP
EAGAIN
.B EAGAIN
Insufficient resources are available to queue any \fIiocb\fRs.
.TP
ENOSYS
.B ENOSYS
\fBio_submit\fR() is not implemented on this architecture.
.SH "CONFORMING TO"
.PP
\fBio_submit\fR() is Linux specific and should not be used in
programs that are intended to be portable.
.SH "VERSIONS"
.PP
The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
.SH "SEE ALSO"
.PP
\fBio_setup\fR(2), \fBio_destroy\fR(2), \fBio_getevents\fR(2),
\fBio_cancel\fR(2).
.SH "NOTES"
.PP
The asynchronous I/O system calls were written by Benjamin LaHaise.
.SH AUTHOR
Kent Yoder.
.\" .SH "NOTES"
.\" .PP
.\" The asynchronous I/O system calls were written by Benjamin LaHaise.
.\" .SH AUTHOR
.\" Kent Yoder.