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

aio_return or aio_return64 Subroutine

Purpose

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

Library

Standard C Library (libc.a)

Syntax

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

Description

The aio_return subroutine retrieves the return status of the asynchronous I/O request associated with the aio_handle_t handle if the I/O request has completed. The status returned is the same as the status that would be returned by the corresponding read or write function calls. If the I/O operation has not completed, the returned status is undefined.

The aio_return64 subroutine is similar to the aio_return 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 is 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_return and aio_return64 subroutines can be called from the process environment only.

Return Values

The aio_return subroutine returns the status of an asynchronous I/O request corresponding to those returned by read or write functions. If the error status returned by the aio_error subroutine call is EINPROG, the value returned by the aio_return subroutine is undefined.

Examples

An aio_read request to read 1000 bytes from a disk device eventually, when the aio_error subroutine returns a 0, causes the aio_return subroutine to return 1000. An aio_read request to read 1000 bytes from a 500 byte file eventually causes the aio_return subroutine to return 500. An aio_write request to write to a read-only file system results in the aio_error subroutine eventually returning EROFS and the aio_return subroutine returning a value of -1.

Implementation Specifics

The aio_return and aio_return64 subroutines are part of Base Operating System (BOS) Runtime.

Related Information

The aio_cancel or aio_cancel64 subroutine, aio_error or aio_error64 subroutine, aio_read or aio_read64 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 ]