[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 1

aio_error or aio_error64 Subroutine


Retrieves the error status of an asynchronous I/O request.


Standard C Library (libc.a)


#include <aio.h>
aio_handle_t handle;
int aio_error64(handle)
aio_handle_t handle;


The aio_error subroutine retrieves the error status of the asynchronous request associated with the handle parameter. The error status is the errno value that would be set by the corresponding I/O operation. The error status is EINPROG if the I/O operation is still in progress.

The aio_error64 subroutine is similar to the aio_error subroutine except that it retrieves the error status associated with an aiocb64 control block.


handle The handle field of an aio control block (aiocb or aiocb64) structure set by a previous call of the aio_read, aio_read64 , aio_write , aio_write64 , lio_listio , aio_listio64 subroutine. If a random memory location is passed in, random results are returned.

Execution Environment

The aio_error and aio_error64 subroutines can be called from the process environment only.

Return Values

0 Indicates that the operation completed successfully.
ECANCELED Indicates that the I/O request was canceled due to an aio_cancel subroutine call.
EINPROG Indicates that the I/O request has not completed.
An errno value described in the aio_read, aio_write, and lio_listio subroutines:
Indicates that the operation was not queued successfully. For example, if the aio_read subroutine is called with an unusable file descriptor, it (aio_read) returns a value of -1 and sets the errno global variable to EBADF. A subsequent call of the aio_error subroutine with the handle of the unsuccessful aio control block (aiocb) structure returns EBADF.
An errno value of the corresponding I/O operation:
Indicates that the operation was initiated successfully, but the actual I/O operation was unsuccessful. For example, calling the aio_write subroutine on a file located in a full file system returns a value of 0, which indicates the request was queued successfully. However, when the I/O operation is complete (that is, when the aio_error subroutine no longer returns EINPROG), the aio_error subroutine returns ENOSPC. This indicates that the I/O was unsuccessful.

Implementation Specifics

The aio_error and aio_error64 subroutines are part of Base Operating System (BOS) Runtime.

Related Information

The aio_cancel or aio_cancel64 subroutine, aio_read or aio_read64 subroutine, aio_return or aio_return64 subroutine, aio_suspend or aio_suspend64 subroutine, aio_write or aio_write64 subroutine, lio_listio or lio_listio64 subroutine.

The Asynchronous I/O Overview and the Communications I/O Subsystem: Programming Introduction in AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts.

The Input and Output Handling Programmer's Overview in AIX General Programming Concepts: Writing and Debugging Programs describes the files, commands, and subroutines used for low-level, stream, terminal, and asynchronous I/O interfaces.

[ Previous | Next | Contents | Glossary | Home | Search ]