Debian Codegraph @

upstream/debian-trixie/man2/io_destroy.2

raw
1 .\" Copyright (C) 2003 Free Software Foundation, Inc.
2 .\"
3 .\" SPDX-License-Identifier: GPL-1.0-or-later
4 .\"
5 .TH io_destroy 2 2024-05-02 "Linux man-pages 6.9.1"
6 .SH NAME
7 io_destroy \- destroy an asynchronous I/O context
8 .SH LIBRARY
9 Standard C library
10 .RI ( libc ", " \-lc )
11 .SH SYNOPSIS
12 .nf
13 .BR "#include <linux/aio_abi.h>" " /* Definition of " aio_context_t " */"
14 .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
15 .B #include <unistd.h>
16 .P
17 .BI "int syscall(SYS_io_destroy, aio_context_t " ctx_id );
18 .fi
19 .P
20 .IR Note :
21 glibc provides no wrapper for
22 .BR io_destroy (),
23 necessitating the use of
24 .BR syscall (2).
25 .SH DESCRIPTION
26 .IR Note :
27 this page describes the raw Linux system call interface.
28 The wrapper function provided by
29 .I libaio
30 uses a different type for the
31 .I ctx_id
32 argument.
33 See VERSIONS.
34 .P
35 The
36 .BR io_destroy ()
37 system call
38 will attempt to cancel all outstanding asynchronous I/O operations against
39 .IR ctx_id ,
40 will block on the completion of all operations
41 that could not be canceled, and will destroy the
42 .IR ctx_id .
43 .SH RETURN VALUE
44 On success,
45 .BR io_destroy ()
46 returns 0.
47 For the failure return, see VERSIONS.
48 .SH ERRORS
49 .TP
50 .B EFAULT
51 The context pointed to is invalid.
52 .TP
53 .B EINVAL
54 The AIO context specified by \fIctx_id\fP is invalid.
55 .TP
56 .B ENOSYS
57 .BR io_destroy ()
58 is not implemented on this architecture.
59 .SH VERSIONS
60 You probably want to use the
61 .BR io_destroy ()
62 wrapper function provided by
63 .\" http://git.fedorahosted.org/git/?p=libaio.git
64 .IR libaio .
65 .P
66 Note that the
67 .I libaio
68 wrapper function uses a different type
69 .RI ( io_context_t )
70 .\" But glibc is confused, since <libaio.h> uses 'io_context_t' to declare
71 .\" the system call.
72 for the
73 .I ctx_id
74 argument.
75 Note also that the
76 .I libaio
77 wrapper does not follow the usual C library conventions for indicating errors:
78 on error it returns a negated error number
79 (the negative of one of the values listed in ERRORS).
80 If the system call is invoked via
81 .BR syscall (2),
82 then the return value follows the usual conventions for
83 indicating an error: \-1, with
84 .I errno
85 set to a (positive) value that indicates the error.
86 .SH STANDARDS
87 Linux.
88 .SH HISTORY
89 Linux 2.5.
90 .SH SEE ALSO
91 .BR io_cancel (2),
92 .BR io_getevents (2),
93 .BR io_setup (2),
94 .BR io_submit (2),
95 .BR aio (7)
96 .\" .SH AUTHOR
97 .\" Kent Yoder.