io_destroy(2)

io_destroy2

Destroy an asynchronous i/o context

Usage

#include <linux/aio_abi.h>    /* Definition of aio_context_t */
#include <sys/syscall.h>      /* Definition of SYS_* constants */
#include <unistd.h>

int syscall(SYS_io_destroy, aio_context_t ctx_id);

Library

Standard C library (libc, -lc)

Overview

Note: you probably want to use the io_destroy(3) wrapper function provided by libaio; see VERSIONS.

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, -1 is returned, and errno is set to indicate the error.

Errors

EFAULT

ctx_id was not a valid address.

EINVAL

The AIO context specified by ctx_id is invalid.

ENOSYS

io_destroy() is not implemented on this architecture.

Versions

libaio ⟨https://pagure.io/libaio⟩ provides a wrapper function with the same name, but different prototype and return value. You probably want to use that wrapper.

Releases

12 releases since Debian 3.1 (Sarge); the text changed 11 times.

  1. 3.1
  2. 4.0
  3. 5.0
  4. 6.0
  5. 7
  6. 8
  7. 9
  8. 10
  9. 11
  10. 12
  11. 13
  12. Arch

Standards

Linux.

History

Linux 2.5.

From man-pages 6.19-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.