OSDN Git Service

(split) LDP: Update original to LDP v3.41.
[linuxjm/LDP_man-pages.git] / original / man2 / io_destroy.2
1 .\" Copyright (C) 2003 Free Software Foundation, Inc.
2 .\" This file is distributed according to the GNU General Public License.
3 .\" See the file COPYING in the top level source directory for details.
4 .\"
5 .\" ..
6 .TH IO_DESTROY 2 2012-05-08 "Linux" "Linux Programmer's Manual"
7 .SH NAME
8 io_destroy \- destroy an asynchronous I/O context
9 .SH "SYNOPSIS"
10 .nf
11 .BR "#include <linux/aio_abi.h>" "          /* Defines needed types */"
12
13 .BI "int io_destroy(aio_context_t " ctx_id );
14 .fi
15 .SH "DESCRIPTION"
16 .PP
17 The
18 .BR io_destroy ()
19 system call
20 removes the asynchronous I/O context specified by
21 .I ctx_id
22 from the list of
23 I/O contexts and then destroys it.
24 It can also cancel any outstanding asynchronous I/O
25 actions on \fIctx_id\fP and block on completion.
26 .SH "RETURN VALUE"
27 On success,
28 .BR io_destroy ()
29 returns 0.
30 For the failure return, see NOTES.
31 .SH "ERRORS"
32 .TP
33 .B EFAULT
34 The context pointed to is invalid.
35 .TP
36 .B EINVAL
37 The AIO context specified by \fIctx_id\fP is invalid.
38 .TP
39 .B ENOSYS
40 .BR io_destroy ()
41 is not implemented on this architecture.
42 .SH "VERSIONS"
43 .PP
44 The asynchronous I/O system calls first appeared in Linux 2.5.
45 .SH "CONFORMING TO"
46 .PP
47 .BR io_destroy ()
48 is Linux-specific and should not be used in programs
49 that are intended to be portable.
50 .SH NOTES
51 Glibc does not provide a wrapper function for this system call.
52 You could invoke it using
53 .BR syscall (2).
54 But instead, you probably want to use the
55 .BR io_destroy ()
56 wrapper function provided by
57 .\" http://git.fedorahosted.org/git/?p=libaio.git
58 .IR libaio .
59
60 Note that the
61 .I libaio
62 wrapper function uses a different type
63 .RI ( io_context_t )
64 .\" But glibc is confused, since <libaio.h> uses 'io_context_t' to declare
65 .\" the system call.
66 for the
67 .I ctx_id
68 argument.
69 Note also that the
70 .I libaio
71 wrapper does not follow the usual C library conventions for indicating errors:
72 on error it returns a negated error number
73 (the negative of one of the values listed in ERRORS).
74 If the system call is invoked via
75 .BR syscall (2),
76 then the return value follows the usual conventions for
77 indicating an error: \-1, with
78 .I errno
79 set to a (positive) value that indicates the error.
80 .SH "SEE ALSO"
81 .BR io_cancel (2),
82 .BR io_getevents (2),
83 .BR io_setup (2),
84 .BR io_submit (2),
85 .BR aio (7)
86 .\" .SH AUTHOR
87 .\" Kent Yoder.