OSDN Git Service

934583a2f2161443bb60da728b04b672cd886010
[linuxjm/LDP_man-pages.git] / original / man3 / aio_cancel.3
1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
12 .\"
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 .\" GNU General Public License for more details.
17 .\"
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
21 .\" USA.
22 .\"
23 .TH AIO_CANCEL 3 2011-10-04  "" "Linux Programmer's Manual"
24 .SH NAME
25 aio_cancel \- cancel an outstanding asynchronous I/O request
26 .SH SYNOPSIS
27 .B "#include <aio.h>"
28 .sp
29 .BI "int aio_cancel(int " fd ", struct aiocb *" aiocbp );
30 .sp
31 Link with \fI\-lrt\fP.
32 .SH DESCRIPTION
33 The
34 .BR aio_cancel ()
35 function attempts to cancel outstanding asynchronous I/O requests
36 for the file descriptor
37 .IR fd .
38 If
39 .I aiocbp
40 is NULL, all such requests are canceled.
41 Otherwise, only the request
42 described by the control block pointed to by
43 .I aiocbp
44 is canceled.
45 (See
46 .BR aio (7)
47 for a description of the
48 .I aiocb
49 structure.)
50 .LP
51 Normal asynchronous notification occurs for canceled requests.
52 The request return status
53 .RB ( aio_return (3))
54 is set to \-1, and the request error status
55 .RB ( aio_error (3))
56 is set to
57 .BR ECANCELED .
58 The control block of requests that cannot be canceled is not changed.
59 .LP
60 If
61 .I aiocbp
62 is not NULL, and
63 .I fd
64 differs from the file descriptor with which the asynchronous operation
65 was initiated, unspecified results occur.
66 .LP
67 Which operations are cancelable is implementation-defined.
68 .\" FreeBSD: not those on raw disk devices.
69 .SH "RETURN VALUE"
70 This function returns
71 .B AIO_CANCELED
72 if all requests were successfully
73 canceled.
74 It returns
75 .B AIO_NOTCANCELED
76 when at least one of the
77 requests specified was not canceled because it was in progress.
78 In this case one may check the status of individual requests using
79 .BR aio_error (3).
80 This function returns
81 .B AIO_ALLDONE
82 if all requests had
83 already been completed before this call.
84 When some error occurs, \-1 is returned, and
85 .I errno
86 is set appropriately.
87 .SH ERRORS
88 .TP
89 .B EBADF
90 .I fd
91 is not a valid file descriptor.
92 .SH VERSIONS
93 The
94 .BR aio_cancel ()
95 function is available since glibc 2.1.
96 .SH "CONFORMING TO"
97 POSIX.1-2001, POSIX.1-2008.
98 .SH EXAMPLE
99 See
100 .BR aio (7).
101 .SH "SEE ALSO"
102 .BR aio_error (3),
103 .BR aio_fsync (3),
104 .BR aio_read (3),
105 .BR aio_return (3),
106 .BR aio_suspend (3),
107 .BR aio_write (3),
108 .BR lio_listio (3),
109 .BR aio (7)