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