OSDN Git Service

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