open.2: Make it clearer that an FD is an index into the process's FD table
[man-pages.git] / man2 / io_destroy.2
blobb439f11846bd7720c3538e7eeaaca479fd26f33e
1 .\" Copyright (C) 2003 Free Software Foundation, Inc.
2 .\"
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" This file is distributed according to the GNU General Public License.
5 .\" %%%LICENSE_END
6 .\"
7 .TH IO_DESTROY 2 2021-03-22 "Linux" "Linux Programmer's Manual"
8 .SH NAME
9 io_destroy \- destroy an asynchronous I/O context
10 .SH SYNOPSIS
11 .nf
12 .BR "#include <linux/aio_abi.h>" "          /* Defines needed types */"
13 .PP
14 .BI "int io_destroy(aio_context_t " ctx_id );
15 .fi
16 .PP
17 .IR Note :
18 There is no glibc wrapper for this system call; see NOTES.
19 .SH DESCRIPTION
20 .IR Note :
21 this page describes the raw Linux system call interface.
22 The wrapper function provided by
23 .I libaio
24 uses a different type for the
25 .I ctx_id
26 argument.
27 See NOTES.
28 .PP
29 The
30 .BR io_destroy ()
31 system call
32 will attempt to cancel all outstanding asynchronous I/O operations against
33 .IR ctx_id ,
34 will block on the completion of all operations
35 that could not be canceled, and will destroy the
36 .IR ctx_id .
37 .SH RETURN VALUE
38 On success,
39 .BR io_destroy ()
40 returns 0.
41 For the failure return, see NOTES.
42 .SH ERRORS
43 .TP
44 .B EFAULT
45 The context pointed to is invalid.
46 .TP
47 .B EINVAL
48 The AIO context specified by \fIctx_id\fP is invalid.
49 .TP
50 .B ENOSYS
51 .BR io_destroy ()
52 is not implemented on this architecture.
53 .SH VERSIONS
54 The asynchronous I/O system calls first appeared in Linux 2.5.
55 .SH CONFORMING TO
56 .BR io_destroy ()
57 is Linux-specific and should not be used in programs
58 that are intended to be portable.
59 .SH NOTES
60 Glibc does not provide a wrapper for this system call.
61 You could invoke it using
62 .BR syscall (2).
63 But instead, 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 .PP
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 SEE ALSO
90 .BR io_cancel (2),
91 .BR io_getevents (2),
92 .BR io_setup (2),
93 .BR io_submit (2),
94 .BR aio (7)
95 .\" .SH AUTHOR
96 .\" Kent Yoder.