| 1 |
.\" Copyright 2003, Free Software Foundation, Inc. |
| 2 |
.\" Copyright, the authors of the Linux man-pages project |
| 3 |
.\" |
| 4 |
.\" SPDX-License-Identifier: GPL-1.0-or-later |
| 5 |
.\" |
| 6 |
.TH io_destroy 2 2026-04-11 "Linux man-pages 6.18" |
| 7 |
.SH NAME |
| 8 |
io_destroy \- destroy an asynchronous I/O context |
| 9 |
.SH LIBRARY |
| 10 |
Standard C library |
| 11 |
.RI ( libc ,\~ \-lc ) |
| 12 |
.SH SYNOPSIS |
| 13 |
.nf |
| 14 |
.BR "#include <linux/aio_abi.h>" " /* Definition of " aio_context_t " */" |
| 15 |
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */" |
| 16 |
.B #include <unistd.h> |
| 17 |
.P |
| 18 |
.BI "int syscall(SYS_io_destroy, aio_context_t " ctx_id ); |
| 19 |
.fi |
| 20 |
.SH DESCRIPTION |
| 21 |
.IR Note : |
| 22 |
you probably want to use the |
| 23 |
.BR io_destroy (3) |
| 24 |
wrapper function provided by |
| 25 |
.IR libaio ; |
| 26 |
see VERSIONS. |
| 27 |
.P |
| 28 |
The |
| 29 |
.BR io_destroy () |
| 30 |
system call |
| 31 |
will attempt to cancel all outstanding asynchronous I/O operations against |
| 32 |
.IR ctx_id , |
| 33 |
will block on the completion of all operations |
| 34 |
that could not be canceled, and will destroy the |
| 35 |
.IR ctx_id . |
| 36 |
.SH RETURN VALUE |
| 37 |
On success, |
| 38 |
.BR io_destroy () |
| 39 |
returns 0. |
| 40 |
On error, |
| 41 |
\-1 is returned, |
| 42 |
and |
| 43 |
.I errno |
| 44 |
is set to indicate the error. |
| 45 |
.SH ERRORS |
| 46 |
.TP |
| 47 |
.B EFAULT |
| 48 |
.I ctx_id |
| 49 |
was not a valid address. |
| 50 |
.TP |
| 51 |
.B EINVAL |
| 52 |
The AIO context specified by |
| 53 |
.I ctx_id |
| 54 |
is invalid. |
| 55 |
.TP |
| 56 |
.B ENOSYS |
| 57 |
.BR io_destroy () |
| 58 |
is not implemented on this architecture. |
| 59 |
.SH VERSIONS |
| 60 |
.UR https://pagure.io/libaio |
| 61 |
.I libaio |
| 62 |
.UE |
| 63 |
provides a wrapper function with the same name, |
| 64 |
but different prototype and return value. |
| 65 |
You probably want to use that wrapper. |
| 66 |
.SH STANDARDS |
| 67 |
Linux. |
| 68 |
.SH HISTORY |
| 69 |
Linux 2.5. |
| 70 |
.SH SEE ALSO |
| 71 |
.BR io_cancel (2), |
| 72 |
.BR io_getevents (2), |
| 73 |
.BR io_setup (2), |
| 74 |
.BR io_submit (2), |
| 75 |
.BR io_destroy (3), |
| 76 |
.BR aio (7) |
| 77 |
.\" .SH AUTHOR |
| 78 |
.\" Kent Yoder. |