OSDN Git Service

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