Cancels one or more outstanding asynchronous I/O requests.
#include <aio.h>
aio_cancel ( FileDescriptor, aiocbp)
int FileDescriptor;
struct aiocb *aiocbp;
aio_cancel64 ( FileDescriptor, aiocbp)
int FileDescriptor;
struct aiocb64 *aiocbp;
The aio_cancel subroutine attempts to cancel one or more outstanding asynchronous I/O requests issued on the file associated with the FileDescriptor parameter. If the pointer to the aio control block (aiocb) structure (the aiocbp parameter) is not null, then an attempt is made to cancel the I/O request associated with this aiocb. The aiocbp parameter used by the thread calling aix_cancel must have had its request initiated by this same thread. Otherwise, a -1 is returned and errno is set to EINVAL. However, if the aiocbp parameter is null, then an attempt is made to cancel all outstanding asynchronous I/O requests associated with the FileDescriptor parameter without regard to the initiating thread.
The aio_cancel64 subroutine is similar to the aio_cancel subroutine except that it attempts to cancel outstanding large file enabled asynchronous I/O requests. Large file enabled asynchronous I/O requests make use of the aiocb64 structure instead of the aiocb structure. The aiocb64 structure allows asynchronous I/O requests to specify offsets in excess of OFF_MAX (2 gigbytes minus 1).
In the large file enabled programming environment, aio_cancel is redefined to be aio_cancel64.
When an I/O request is canceled, the aio_error (aio_error or aio_error64 Subroutine) subroutine called with the handle to the corresponding aiocb structure returns ECANCELED.
The aio_cancel and aio_cancel64 subroutines can be called from the process environment only.
A return code can be set to the
following errno value:
EBADF | Indicates that the FileDescriptor parameter is not valid. |
The aio_cancel or aio_cancel64 subroutine is part of Base Operating System (BOS) Runtime.
The aio_error or aio_error64 (aio_error or aio_error64 Subroutine) subroutine, aio_read or aio_read64 (aio_read or aio_read64 Subroutine) subroutine, aio_return or aio_return64 (aio_return or aio_return64 Subroutine) subroutine, aio_suspend or aio_suspend64 (aio_suspend or aio_suspend64 Subroutine) subroutine, aio_write or aio_write64 (aio_write or aio_write64 Subroutine) subroutine, lio_listio or lio_listo64 (lio_listio or lio_listio64 Subroutine) subroutine.
The Asynchronous I/O Subsystem and Communications I/O Subsystem in AIX 5L Version 5.1 Kernel Extensions and Device Support Programming Concepts.
The Input and Output Handling in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs describes the files, commands, and subroutines used for low-level, stream, terminal, and asynchronous I/O interfaces.