OSDN Git Service

8b8027580184aaf8e3f0353e651c264e9956f7c2
[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 2012-05-08  "" "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 (see
52 .BR aio (7)
53 and
54 .BR sigevent (7)).
55 The request return status
56 .RB ( aio_return (3))
57 is set to \-1, and the request error status
58 .RB ( aio_error (3))
59 is set to
60 .BR ECANCELED .
61 The control block of requests that cannot be canceled is not changed.
62 .LP
63 If the request could not be canceled,
64 then it will terminate in the usual way after performing the I/O operation.
65 (In this case,
66 .BR aio_error (3)
67 will return the status
68 .BR EINPROGRESSS .)
69 .LP
70 If
71 .I aiocbp
72 is not NULL, and
73 .I fd
74 differs from the file descriptor with which the asynchronous operation
75 was initiated, unspecified results occur.
76 .LP
77 Which operations are cancelable is implementation-defined.
78 .\" FreeBSD: not those on raw disk devices.
79 .SH "RETURN VALUE"
80 The
81 .BR aio_cancel ()
82 function returns one of the following values:
83 .TP
84 .B AIO_CANCELED
85 All requests were successfully canceled.
86 .TP
87 .B AIO_NOTCANCELED
88 At least one of the
89 requests specified was not canceled because it was in progress.
90 In this case, one may check the status of individual requests using
91 .BR aio_error (3).
92 .TP
93 .B AIO_ALLDONE
94 All requests had already been completed before the call.
95 .TP
96 \-1
97 An error occurred.
98 The cause of the error can be found by inspecting
99 .IR errno .
100 .SH ERRORS
101 .TP
102 .B EBADF
103 .I fd
104 is not a valid file descriptor.
105 .TP
106 .B ENOSYS
107 .BR aio_cancel()
108 is not implemented.
109 .SH VERSIONS
110 The
111 .BR aio_cancel ()
112 function is available since glibc 2.1.
113 .SH "CONFORMING TO"
114 POSIX.1-2001, POSIX.1-2008.
115 .SH EXAMPLE
116 See
117 .BR aio (7).
118 .SH "SEE ALSO"
119 .BR aio_error (3),
120 .BR aio_fsync (3),
121 .BR aio_read (3),
122 .BR aio_return (3),
123 .BR aio_suspend (3),
124 .BR aio_write (3),
125 .BR lio_listio (3),
126 .BR aio (7)