Scroll to navigation

io_destroy(2) System Calls Manual io_destroy(2)

NAME

io_destroy - destroy an asynchronous I/O context

LIBRARY

Standard C library (libc-lc)

SYNOPSIS

#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);

DESCRIPTION

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

ctx_id was not a valid address.
The AIO context specified by ctx_id is invalid.
io_destroy() is not implemented on this architecture.

VERSIONS

libaio provides a wrapper function with the same name, but different prototype and return value. You probably want to use that wrapper.

STANDARDS

Linux.

HISTORY

Linux 2.5.

SEE ALSO

io_cancel(2), io_getevents(2), io_setup(2), io_submit(2), io_destroy(3), aio(7)

2026-04-11 Linux man-pages 6.18