OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / original / man2 / io_cancel.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 .\" .de Sh \" Subsection
6 .\" .br
7 .\" .if t .Sp
8 .\" .ne 5
9 .\" .PP
10 .\" \fB\\$1\fP
11 .\" .PP
12 .\" ..
13 .\" .de Sp \" Vertical space (when we can't use .PP)
14 .\" .if t .sp .5v
15 .\" .if n .sp
16 .\" ..
17 .\" .de Ip \" List item
18 .\" .br
19 .\" .ie \\n(.$>=3 .ne \\$3
20 .\" .el .ne 3
21 .\" .IP "\\$1" \\$2
22 .\" ..
23 .TH IO_CANCEL 2 2008-06-18 "Linux" "Linux Programmer's Manual"
24 .SH NAME
25 io_cancel \- cancel an outstanding asynchronous I/O operation
26 .SH "SYNOPSIS"
27 .nf
28 .\" .ad l
29 .\" .hy 0
30 .\"
31 .B #include <libaio.h>
32 .\"#include <linux/aio.h>
33 .sp
34 .\" .HP 16
35 .BI "int io_cancel(aio_context_t " ctx_id ", struct iocb *" iocb ,
36 .BI "              struct io_event *" result );
37 .\" .ad
38 .\" .hy
39 .sp
40 Link with \fI\-laio\fP.
41 .fi
42 .SH "DESCRIPTION"
43 .PP
44 .BR io_cancel ()
45 attempts to cancel an asynchronous I/O operation previously submitted with
46 .BR io_submit (2).
47 \fIctx_id\fP is the AIO context ID of the operation to be canceled.
48 If the AIO context is found, the event will be canceled and then copied
49 into the memory pointed to by \fIresult\fP without being placed
50 into the completion queue.
51 .SH "RETURN VALUE"
52 On success,
53 .BR io_cancel ()
54 returns 0.
55 For the failure return, see NOTES.
56 .SH "ERRORS"
57 .TP
58 .B EAGAIN
59 The \fIiocb\fP specified was not canceled.
60 .TP
61 .B EFAULT
62 One of the data structures points to invalid data.
63 .TP
64 .B EINVAL
65 The AIO context specified by \fIctx_id\fP is invalid.
66 .TP
67 .B ENOSYS
68 .BR io_cancel ()
69 is not implemented on this architecture.
70 .SH "VERSIONS"
71 .PP
72 The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
73 .SH "CONFORMING TO"
74 .PP
75 .BR io_cancel ()
76 is Linux-specific and should not be used
77 in programs that are intended to be portable.
78 .SH NOTES
79 Glibc does not provide a wrapper function for this system call.
80
81 The wrapper provided in
82 .I libaio
83 for
84 .BR io_cancel ()
85 does not follow the usual C library conventions for indicating error:
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 .\" .SH "NOTES"
100 .\"
101 .\" .PP
102 .\" The asynchronous I/O system calls were written by Benjamin LaHaise.
103 .\"
104 .\" .SH AUTHOR
105 .\" Kent Yoder.