OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / original / man3 / aio_cancel.3
1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\"
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
13 .\"
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 .\" GNU General Public License for more details.
18 .\"
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, see
21 .\" <http://www.gnu.org/licenses/>.
22 .\" %%%LICENSE_END
23 .\"
24 .TH AIO_CANCEL 3 2012-05-08  "" "Linux Programmer's Manual"
25 .SH NAME
26 aio_cancel \- cancel an outstanding asynchronous I/O request
27 .SH SYNOPSIS
28 .B "#include <aio.h>"
29 .sp
30 .BI "int aio_cancel(int " fd ", struct aiocb *" aiocbp );
31 .sp
32 Link with \fI\-lrt\fP.
33 .SH DESCRIPTION
34 The
35 .BR aio_cancel ()
36 function attempts to cancel outstanding asynchronous I/O requests
37 for the file descriptor
38 .IR fd .
39 If
40 .I aiocbp
41 is NULL, all such requests are canceled.
42 Otherwise, only the request
43 described by the control block pointed to by
44 .I aiocbp
45 is canceled.
46 (See
47 .BR aio (7)
48 for a description of the
49 .I aiocb
50 structure.)
51 .LP
52 Normal asynchronous notification occurs for canceled requests (see
53 .BR aio (7)
54 and
55 .BR sigevent (7)).
56 The request return status
57 .RB ( aio_return (3))
58 is set to \-1, and the request error status
59 .RB ( aio_error (3))
60 is set to
61 .BR ECANCELED .
62 The control block of requests that cannot be canceled is not changed.
63 .LP
64 If the request could not be canceled,
65 then it will terminate in the usual way after performing the I/O operation.
66 (In this case,
67 .BR aio_error (3)
68 will return the status
69 .BR EINPROGRESSS .)
70 .LP
71 If
72 .I aiocbp
73 is not NULL, and
74 .I fd
75 differs from the file descriptor with which the asynchronous operation
76 was initiated, unspecified results occur.
77 .LP
78 Which operations are cancelable is implementation-defined.
79 .\" FreeBSD: not those on raw disk devices.
80 .SH RETURN VALUE
81 The
82 .BR aio_cancel ()
83 function returns one of the following values:
84 .TP
85 .B AIO_CANCELED
86 All requests were successfully canceled.
87 .TP
88 .B AIO_NOTCANCELED
89 At least one of the
90 requests specified was not canceled because it was in progress.
91 In this case, one may check the status of individual requests using
92 .BR aio_error (3).
93 .TP
94 .B AIO_ALLDONE
95 All requests had already been completed before the call.
96 .TP
97 \-1
98 An error occurred.
99 The cause of the error can be found by inspecting
100 .IR errno .
101 .SH ERRORS
102 .TP
103 .B EBADF
104 .I fd
105 is not a valid file descriptor.
106 .TP
107 .B ENOSYS
108 .BR aio_cancel ()
109 is not implemented.
110 .SH VERSIONS
111 The
112 .BR aio_cancel ()
113 function is available since glibc 2.1.
114 .SH CONFORMING TO
115 POSIX.1-2001, POSIX.1-2008.
116 .SH EXAMPLE
117 See
118 .BR aio (7).
119 .SH SEE ALSO
120 .BR aio_error (3),
121 .BR aio_fsync (3),
122 .BR aio_read (3),
123 .BR aio_return (3),
124 .BR aio_suspend (3),
125 .BR aio_write (3),
126 .BR lio_listio (3),
127 .BR aio (7)
128 .SH COLOPHON
129 This page is part of release 3.79 of the Linux
130 .I man-pages
131 project.
132 A description of the project,
133 information about reporting bugs,
134 and the latest version of this page,
135 can be found at
136 \%http://www.kernel.org/doc/man\-pages/.