[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1


aio_error or aio_error64 Subroutine

Purpose

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

Library

Standard C Library (libc.a)

Syntax

#include <aio.h>


int
aio_error(
handle)
aio_handle_t handle;


int aio_error64( handle)
aio_handle_t handle;

Description

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.

Parameters


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_read or aio_read64 Subroutine), aio_write (aio_write or aio_write64 Subroutine), and lio_listio (lio_listio or lio_listio64 Subroutine) 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 (aio_cancel or aio_cancel64 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 (lio_listio or lio_listio64 Subroutine) or lio_listio64 (lio_listio or lio_listio64 Subroutine) subroutine.

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

The Input and Output Handling Programmer's Overview 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.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]