]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/aio_cancel.3
getent.1, intro.1, time.1, _exit.2, _syscall.2, accept.2, access.2, acct.2, adjtimex...
[thirdparty/man-pages.git] / man3 / aio_cancel.3
CommitLineData
fea681da
MK
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.\"
bc8e7b95 23.TH AIO_CANCEL 3 2012-05-08 "" "Linux Programmer's Manual"
fea681da
MK
24.SH NAME
25aio_cancel \- cancel an outstanding asynchronous I/O request
26.SH SYNOPSIS
fea681da
MK
27.B "#include <aio.h>"
28.sp
29.BI "int aio_cancel(int " fd ", struct aiocb *" aiocbp );
0ad25472
MK
30.sp
31Link with \fI\-lrt\fP.
fea681da
MK
32.SH DESCRIPTION
33The
e511ffb6 34.BR aio_cancel ()
fea681da
MK
35function attempts to cancel outstanding asynchronous I/O requests
36for the file descriptor
37.IR fd .
38If
39.I aiocbp
d9bfdb9c 40is NULL, all such requests are canceled.
c13182ef 41Otherwise, only the request
fea681da
MK
42described by the control block pointed to by
43.I aiocbp
d9bfdb9c 44is canceled.
2b014d76
MK
45(See
46.BR aio (7)
47for a description of the
48.I aiocb
49structure.)
fea681da 50.LP
2da75a9e
MK
51Normal asynchronous notification occurs for canceled requests (see
52.BR aio (7)
53and
54.BR sigevent (7)).
4de52db8
MK
55The request return status
56.RB ( aio_return (3))
57is set to \-1, and the request error status
58.RB ( aio_error (3))
2f0af33b
MK
59is set to
60.BR ECANCELED .
d9bfdb9c 61The control block of requests that cannot be canceled is not changed.
fea681da 62.LP
bc8e7b95
MK
63If the request could not be canceled,
64then it will terminate in the usual way after performing the I/O operation.
65(In this case,
66.BR aio_error (3)
67will return the status
68.BR EINPROGRESSS .)
69.LP
fea681da
MK
70If
71.I aiocbp
72is not NULL, and
73.I fd
74differs from the file descriptor with which the asynchronous operation
75was initiated, unspecified results occur.
76.LP
4c3fb935 77Which operations are cancelable is implementation-defined.
fea681da 78.\" FreeBSD: not those on raw disk devices.
47297adb 79.SH RETURN VALUE
fb07934b
MK
80The
81.BR aio_cancel ()
82function returns one of the following values:
83.TP
2f0af33b 84.B AIO_CANCELED
fb07934b
MK
85All requests were successfully canceled.
86.TP
1274071a 87.B AIO_NOTCANCELED
fb07934b 88At least one of the
d9bfdb9c 89requests specified was not canceled because it was in progress.
fb07934b 90In this case, one may check the status of individual requests using
fea681da 91.BR aio_error (3).
fb07934b 92.TP
2f0af33b 93.B AIO_ALLDONE
fb07934b
MK
94All requests had already been completed before the call.
95.TP
96\-1
97An error occurred.
98The cause of the error can be found by inspecting
99.IR errno .
fea681da
MK
100.SH ERRORS
101.TP
102.B EBADF
103.I fd
104is not a valid file descriptor.
aea038d6
MK
105.TP
106.B ENOSYS
02ace852 107.BR aio_cancel ()
aea038d6 108is not implemented.
793514ae
MK
109.SH VERSIONS
110The
111.BR aio_cancel ()
112function is available since glibc 2.1.
47297adb 113.SH CONFORMING TO
793514ae 114POSIX.1-2001, POSIX.1-2008.
b44bee16
MK
115.SH EXAMPLE
116See
117.BR aio (7).
47297adb 118.SH SEE ALSO
fea681da
MK
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),
25fa6c3d 124.BR aio_write (3),
cd587df6 125.BR lio_listio (3),
25fa6c3d 126.BR aio (7)