Debian Codegraph @

upstream/mageia-cauldron/man2/io_destroy.2

raw
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 2025-05-17 "Linux man-pages 6.17"
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 .P
21 .IR Note :
22 glibc provides no wrapper for
23 .BR io_destroy (),
24 necessitating the use of
25 .BR syscall (2).
26 .SH DESCRIPTION
27 .IR Note :
28 this page describes the raw Linux system call interface.
29 The wrapper function provided by
30 .I libaio
31 uses a different type for the
32 .I ctx_id
33 argument.
34 See VERSIONS.
35 .P
36 The
37 .BR io_destroy ()
38 system call
39 will attempt to cancel all outstanding asynchronous I/O operations against
40 .IR ctx_id ,
41 will block on the completion of all operations
42 that could not be canceled, and will destroy the
43 .IR ctx_id .
44 .SH RETURN VALUE
45 On success,
46 .BR io_destroy ()
47 returns 0.
48 For the failure return, see VERSIONS.
49 .SH ERRORS
50 .TP
51 .B EFAULT
52 The context pointed to is invalid.
53 .TP
54 .B EINVAL
55 The AIO context specified by
56 .I ctx_id
57 is invalid.
58 .TP
59 .B ENOSYS
60 .BR io_destroy ()
61 is not implemented on this architecture.
62 .SH VERSIONS
63 You probably want to use the
64 .BR io_destroy ()
65 wrapper function provided by
66 .\" http://git.fedorahosted.org/git/?p=libaio.git
67 .IR libaio .
68 .P
69 Note that the
70 .I libaio
71 wrapper function uses a different type
72 .RI ( io_context_t )
73 .\" But glibc is confused, since <libaio.h> uses 'io_context_t' to declare
74 .\" the system call.
75 for the
76 .I ctx_id
77 argument.
78 Note also that the
79 .I libaio
80 wrapper does not follow the usual C library conventions for indicating errors:
81 on error it returns a negated error number
82 (the negative of one of the values listed in ERRORS).
83 If the system call is invoked via
84 .BR syscall (2),
85 then the return value follows the usual conventions for
86 indicating an error: \-1, with
87 .I errno
88 set to a (positive) value that indicates the error.
89 .SH STANDARDS
90 Linux.
91 .SH HISTORY
92 Linux 2.5.
93 .SH SEE ALSO
94 .BR io_cancel (2),
95 .BR io_getevents (2),
96 .BR io_setup (2),
97 .BR io_submit (2),
98 .BR aio (7)
99 .\" .SH AUTHOR
100 .\" Kent Yoder.