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

# io\_destroy(3)

destroy an asynchronous I/O context

## NAME

io\_destroy - destroy an asynchronous I/O context

## LIBRARY

Asynchronous I/O library (*libaio*, *-laio*)

## SYNOPSIS

```
#include <libaio.h>
```

**long io\_destroy(io\_context\_t \****ctx\_idp***);**

## DESCRIPTION

The **io\_destroy**() system call will attempt to cancel all outstanding asynchronous I/O operations against *ctx\_id*, will block on the completion of all operations that could not be canceled, and will destroy the *ctx\_id*.

## RETURN VALUE

On success, **io\_destroy**() returns 0. On error, a negative error code is returned to indicate the error.

## ERRORS

See [**io\_destroy**(2)](/io_destroy/2.md).

## STANDARDS

libaio.

## HISTORY

libaio.

## SEE ALSO

[**io\_destroy**(2)](/io_destroy/2.md), [**io**(3)](/io/3.md), [**aio**(7)](/aio/7.md)
