---
name: "aio_error"
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_error/3"
---

# aio\_error(3)

get error status of asynchronous I/O operation

## NAME

aio\_error - get error status of asynchronous I/O operation

## LIBRARY

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

## SYNOPSIS

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

**int aio\_error(const struct aiocb \****aiocbp***);**

## DESCRIPTION

The **aio\_error**() function returns the error 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.)

## RETURN VALUE

This function returns one of the following:

- **EINPROGRESS**

  if the request has not been completed yet.

- **ECANCELED**

  if the request was canceled.

- **0**

  if the request completed successfully.

- \> **0**

  A positive error number, if the asynchronous I/O operation failed. This is the same value that would have been stored in the *errno* variable in the 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.

## ERRORS

- **EINVAL**

  *aiocbp* does not point at a control block for an asynchronous I/O request of which the return status (see [**aio\_return**(3)](/aio_return/3.md)) has not been retrieved yet.

- **ENOSYS**

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

## ATTRIBUTES

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

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **aio\_error**() | 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\_fsync**(3)](/aio_fsync/3.md), [**aio\_read**(3)](/aio_read/3.md), [**aio\_return**(3)](/aio_return/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)
