]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/aio_cancel.3
user_namespaces.7: Minor rewordings of recently added text
[thirdparty/man-pages.git] / man3 / aio_cancel.3
CommitLineData
fea681da
MK
1.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
2.\"
1dd72f9c 3.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
fea681da
MK
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
c715f741
MK
20.\" License along with this manual; if not, see
21.\" <http://www.gnu.org/licenses/>.
6a8d8745 22.\" %%%LICENSE_END
fea681da 23.\"
fe0fefbf 24.TH AIO_CANCEL 3 2015-03-02 "" "Linux Programmer's Manual"
fea681da
MK
25.SH NAME
26aio_cancel \- cancel an outstanding asynchronous I/O request
27.SH SYNOPSIS
fea681da 28.B "#include <aio.h>"
68e4db0a 29.PP
fea681da 30.BI "int aio_cancel(int " fd ", struct aiocb *" aiocbp );
68e4db0a 31.PP
0ad25472 32Link with \fI\-lrt\fP.
fea681da
MK
33.SH DESCRIPTION
34The
e511ffb6 35.BR aio_cancel ()
fea681da
MK
36function attempts to cancel outstanding asynchronous I/O requests
37for the file descriptor
38.IR fd .
39If
40.I aiocbp
d9bfdb9c 41is NULL, all such requests are canceled.
c13182ef 42Otherwise, only the request
fea681da
MK
43described by the control block pointed to by
44.I aiocbp
d9bfdb9c 45is canceled.
2b014d76
MK
46(See
47.BR aio (7)
48for a description of the
49.I aiocb
50structure.)
dd3568a1 51.PP
2da75a9e
MK
52Normal asynchronous notification occurs for canceled requests (see
53.BR aio (7)
54and
55.BR sigevent (7)).
4de52db8
MK
56The request return status
57.RB ( aio_return (3))
58is set to \-1, and the request error status
59.RB ( aio_error (3))
2f0af33b
MK
60is set to
61.BR ECANCELED .
d9bfdb9c 62The control block of requests that cannot be canceled is not changed.
dd3568a1 63.PP
bc8e7b95
MK
64If the request could not be canceled,
65then it will terminate in the usual way after performing the I/O operation.
66(In this case,
67.BR aio_error (3)
68will return the status
69.BR EINPROGRESSS .)
dd3568a1 70.PP
fea681da
MK
71If
72.I aiocbp
73is not NULL, and
74.I fd
75differs from the file descriptor with which the asynchronous operation
76was initiated, unspecified results occur.
dd3568a1 77.PP
4c3fb935 78Which operations are cancelable is implementation-defined.
fea681da 79.\" FreeBSD: not those on raw disk devices.
47297adb 80.SH RETURN VALUE
fb07934b
MK
81The
82.BR aio_cancel ()
83function returns one of the following values:
84.TP
2f0af33b 85.B AIO_CANCELED
fb07934b
MK
86All requests were successfully canceled.
87.TP
1274071a 88.B AIO_NOTCANCELED
fb07934b 89At least one of the
d9bfdb9c 90requests specified was not canceled because it was in progress.
fb07934b 91In this case, one may check the status of individual requests using
fea681da 92.BR aio_error (3).
fb07934b 93.TP
2f0af33b 94.B AIO_ALLDONE
fb07934b
MK
95All requests had already been completed before the call.
96.TP
97\-1
98An error occurred.
99The cause of the error can be found by inspecting
100.IR errno .
fea681da
MK
101.SH ERRORS
102.TP
103.B EBADF
104.I fd
105is not a valid file descriptor.
aea038d6
MK
106.TP
107.B ENOSYS
02ace852 108.BR aio_cancel ()
aea038d6 109is not implemented.
793514ae
MK
110.SH VERSIONS
111The
112.BR aio_cancel ()
113function is available since glibc 2.1.
18e212e0
MS
114.SH ATTRIBUTES
115For an explanation of the terms used in this section, see
116.BR attributes (7).
117.TS
118allbox;
119lb lb lb
120l l l.
121Interface Attribute Value
122T{
123.BR aio_cancel ()
124T} Thread safety MT-Safe
125.TE
47297adb 126.SH CONFORMING TO
793514ae 127POSIX.1-2001, POSIX.1-2008.
b44bee16
MK
128.SH EXAMPLE
129See
130.BR aio (7).
47297adb 131.SH SEE ALSO
fea681da
MK
132.BR aio_error (3),
133.BR aio_fsync (3),
134.BR aio_read (3),
135.BR aio_return (3),
136.BR aio_suspend (3),
25fa6c3d 137.BR aio_write (3),
cd587df6 138.BR lio_listio (3),
25fa6c3d 139.BR aio (7)