---
name: "aio_return"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/aio_return/3"
---

# aio\_return(3)

get return status of asynchronous I/O operation

## NAME

aio\_return - get return status of asynchronous I/O operation

## LIBRARY

Real-time library (*librt*, *-lrt*)

## SYNOPSIS

```
#include <aio.h>
```

**ssize\_t aio\_return(struct aiocb \****aiocbp***);**

## DESCRIPTION

The **aio\_return**() function returns the final return status for the asynchronous I/O request with control block pointed to by *aiocbp*. (See [**aio**(7)](/aio/7.md) for a description of the *aiocb* structure.)

This function should be called only once for any given request, after [**aio\_error**(3)](/aio_error/3.md) returns something other than **EINPROGRESS**.

## RETURN VALUE

If the asynchronous I/O operation has completed, this function returns the value that would have been returned in case of a synchronous [**read**(2)](/read/2.md), [**write**(2)](/write/2.md), [**fsync**(2)](/fsync/2.md), or [**fdatasync**(2)](/fdatasync/2.md), call. On error, -1 is returned, and *errno* is set to indicate the error.

If the asynchronous I/O operation has not yet completed, the return value and effect of **aio\_return**() are undefined.

## ERRORS

- **EINVAL**

  *aiocbp* does not point at a control block for an asynchronous I/O request of which the return status has not been retrieved yet.

- **ENOSYS**

  **aio\_return**() is not implemented.

## ATTRIBUTES

For an explanation of the terms used in this section, see [**attributes**(7)](/attributes/7.md).

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **aio\_return**() | Thread safety | MT-Safe |

## STANDARDS

POSIX.1-2008.

## HISTORY

glibc 2.1. POSIX.1-2001.

## EXAMPLES

See [**aio**(7)](/aio/7.md).

## SEE ALSO

[**aio\_cancel**(3)](/aio_cancel/3.md), [**aio\_error**(3)](/aio_error/3.md), [**aio\_fsync**(3)](/aio_fsync/3.md), [**aio\_read**(3)](/aio_read/3.md), [**aio\_suspend**(3)](/aio_suspend/3.md), [**aio\_write**(3)](/aio_write/3.md), [**lio\_listio**(3)](/lio_listio/3.md), [**aio**(7)](/aio/7.md)
