2004-11-03 13:51:07 +00:00
|
|
|
.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
|
|
|
|
.\"
|
|
|
|
.\" This is free documentation; you can redistribute it and/or
|
|
|
|
.\" modify it under the terms of the GNU General Public License as
|
|
|
|
.\" published by the Free Software Foundation; either version 2 of
|
|
|
|
.\" the License, or (at your option) any later version.
|
|
|
|
.\"
|
|
|
|
.\" The GNU General Public License's references to "object code"
|
|
|
|
.\" and "executables" are to be interpreted as the output of any
|
|
|
|
.\" document formatting or typesetting system, including
|
|
|
|
.\" intermediate and printed output.
|
|
|
|
.\"
|
|
|
|
.\" This manual is distributed in the hope that it will be useful,
|
|
|
|
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
.\" GNU General Public License for more details.
|
|
|
|
.\"
|
|
|
|
.\" You should have received a copy of the GNU General Public
|
|
|
|
.\" License along with this manual; if not, write to the Free
|
|
|
|
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
|
|
|
|
.\" USA.
|
|
|
|
.\"
|
2012-05-08 00:25:35 +00:00
|
|
|
.TH AIO_CANCEL 3 2012-05-08 "" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
|
|
|
aio_cancel \- cancel an outstanding asynchronous I/O request
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B "#include <aio.h>"
|
|
|
|
.sp
|
|
|
|
.BI "int aio_cancel(int " fd ", struct aiocb *" aiocbp );
|
2008-04-25 06:35:53 +00:00
|
|
|
.sp
|
|
|
|
Link with \fI\-lrt\fP.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH DESCRIPTION
|
|
|
|
The
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR aio_cancel ()
|
2004-11-03 13:51:07 +00:00
|
|
|
function attempts to cancel outstanding asynchronous I/O requests
|
|
|
|
for the file descriptor
|
|
|
|
.IR fd .
|
|
|
|
If
|
|
|
|
.I aiocbp
|
2007-06-08 09:56:56 +00:00
|
|
|
is NULL, all such requests are canceled.
|
2007-04-12 22:42:49 +00:00
|
|
|
Otherwise, only the request
|
2004-11-03 13:51:07 +00:00
|
|
|
described by the control block pointed to by
|
|
|
|
.I aiocbp
|
2007-06-08 09:56:56 +00:00
|
|
|
is canceled.
|
2010-10-02 13:27:41 +00:00
|
|
|
(See
|
|
|
|
.BR aio (7)
|
|
|
|
for a description of the
|
|
|
|
.I aiocb
|
|
|
|
structure.)
|
2004-11-03 13:51:07 +00:00
|
|
|
.LP
|
2012-05-08 00:29:07 +00:00
|
|
|
Normal asynchronous notification occurs for canceled requests (see
|
|
|
|
.BR aio (7)
|
|
|
|
and
|
|
|
|
.BR sigevent (7)).
|
2011-10-04 05:41:01 +00:00
|
|
|
The request return status
|
|
|
|
.RB ( aio_return (3))
|
|
|
|
is set to \-1, and the request error status
|
|
|
|
.RB ( aio_error (3))
|
2007-06-22 19:42:52 +00:00
|
|
|
is set to
|
|
|
|
.BR ECANCELED .
|
2007-06-08 09:56:56 +00:00
|
|
|
The control block of requests that cannot be canceled is not changed.
|
2004-11-03 13:51:07 +00:00
|
|
|
.LP
|
2012-05-08 00:25:35 +00:00
|
|
|
If the request could not be canceled,
|
|
|
|
then it will terminate in the usual way after performing the I/O operation.
|
|
|
|
(In this case,
|
|
|
|
.BR aio_error (3)
|
|
|
|
will return the status
|
|
|
|
.BR EINPROGRESSS .)
|
|
|
|
.LP
|
2004-11-03 13:51:07 +00:00
|
|
|
If
|
|
|
|
.I aiocbp
|
|
|
|
is not NULL, and
|
|
|
|
.I fd
|
|
|
|
differs from the file descriptor with which the asynchronous operation
|
|
|
|
was initiated, unspecified results occur.
|
|
|
|
.LP
|
2010-10-02 12:37:24 +00:00
|
|
|
Which operations are cancelable is implementation-defined.
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" FreeBSD: not those on raw disk devices.
|
|
|
|
.SH "RETURN VALUE"
|
2012-04-17 20:15:11 +00:00
|
|
|
The
|
|
|
|
.BR aio_cancel ()
|
|
|
|
function returns one of the following values:
|
|
|
|
.TP
|
2007-06-22 19:42:52 +00:00
|
|
|
.B AIO_CANCELED
|
2012-04-17 20:15:11 +00:00
|
|
|
All requests were successfully canceled.
|
|
|
|
.TP
|
2007-06-22 18:25:23 +00:00
|
|
|
.B AIO_NOTCANCELED
|
2012-04-17 20:15:11 +00:00
|
|
|
At least one of the
|
2007-06-08 09:56:56 +00:00
|
|
|
requests specified was not canceled because it was in progress.
|
2012-04-17 20:15:11 +00:00
|
|
|
In this case, one may check the status of individual requests using
|
2004-11-03 13:51:07 +00:00
|
|
|
.BR aio_error (3).
|
2012-04-17 20:15:11 +00:00
|
|
|
.TP
|
2007-06-22 19:42:52 +00:00
|
|
|
.B AIO_ALLDONE
|
2012-04-17 20:15:11 +00:00
|
|
|
All requests had already been completed before the call.
|
|
|
|
.TP
|
|
|
|
\-1
|
|
|
|
An error occurred.
|
|
|
|
The cause of the error can be found by inspecting
|
|
|
|
.IR errno .
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH ERRORS
|
|
|
|
.TP
|
|
|
|
.B EBADF
|
|
|
|
.I fd
|
|
|
|
is not a valid file descriptor.
|
2012-05-08 01:30:18 +00:00
|
|
|
.TP
|
|
|
|
.B ENOSYS
|
2012-06-07 13:18:51 +00:00
|
|
|
.BR aio_cancel ()
|
2012-05-08 01:30:18 +00:00
|
|
|
is not implemented.
|
2010-10-02 12:35:28 +00:00
|
|
|
.SH VERSIONS
|
|
|
|
The
|
|
|
|
.BR aio_cancel ()
|
|
|
|
function is available since glibc 2.1.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "CONFORMING TO"
|
2010-10-02 12:35:28 +00:00
|
|
|
POSIX.1-2001, POSIX.1-2008.
|
2010-10-03 05:19:04 +00:00
|
|
|
.SH EXAMPLE
|
|
|
|
See
|
|
|
|
.BR aio (7).
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR aio_error (3),
|
|
|
|
.BR aio_fsync (3),
|
|
|
|
.BR aio_read (3),
|
|
|
|
.BR aio_return (3),
|
|
|
|
.BR aio_suspend (3),
|
2010-10-02 13:16:38 +00:00
|
|
|
.BR aio_write (3),
|
2010-10-04 04:23:09 +00:00
|
|
|
.BR lio_listio (3),
|
2010-10-02 13:16:38 +00:00
|
|
|
.BR aio (7)
|