summaryrefslogtreecommitdiffstats
path: root/man3/aio_cancel.3
blob: e8ef7d5a05123a85d86dbb6ba23bb9575eff4935 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
'\" t
.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
.\"
.\" SPDX-License-Identifier: GPL-2.0-or-later
.\"
.TH aio_cancel 3 2023-07-20 "Linux man-pages 6.05.01"
.SH NAME
aio_cancel \- cancel an outstanding asynchronous I/O request
.SH LIBRARY
Real-time library
.RI ( librt ", " \-lrt )
.SH SYNOPSIS
.nf
.B "#include <aio.h>"
.PP
.BI "int aio_cancel(int " fd ", struct aiocb *" aiocbp );
.fi
.SH DESCRIPTION
The
.BR aio_cancel ()
function attempts to cancel outstanding asynchronous I/O requests
for the file descriptor
.IR fd .
If
.I aiocbp
is NULL, all such requests are canceled.
Otherwise, only the request
described by the control block pointed to by
.I aiocbp
is canceled.
(See
.BR aio (7)
for a description of the
.I aiocb
structure.)
.PP
Normal asynchronous notification occurs for canceled requests (see
.BR aio (7)
and
.BR sigevent (7)).
The request return status
.RB ( aio_return (3))
is set to \-1, and the request error status
.RB ( aio_error (3))
is set to
.BR ECANCELED .
The control block of requests that cannot be canceled is not changed.
.PP
If the request could not be canceled,
then it will terminate in the usual way after performing the I/O operation.
(In this case,
.BR aio_error (3)
will return the status
.BR EINPROGRESSS .)
.PP
If
.I aiocbp
is not NULL, and
.I fd
differs from the file descriptor with which the asynchronous operation
was initiated, unspecified results occur.
.PP
Which operations are cancelable is implementation-defined.
.\" FreeBSD: not those on raw disk devices.
.SH RETURN VALUE
The
.BR aio_cancel ()
function returns one of the following values:
.TP
.B AIO_CANCELED
All requests were successfully canceled.
.TP
.B AIO_NOTCANCELED
At least one of the
requests specified was not canceled because it was in progress.
In this case, one may check the status of individual requests using
.BR aio_error (3).
.TP
.B AIO_ALLDONE
All requests had already been completed before the call.
.TP
\-1
An error occurred.
The cause of the error can be found by inspecting
.IR errno .
.SH ERRORS
.TP
.B EBADF
.I fd
is not a valid file descriptor.
.TP
.B ENOSYS
.BR aio_cancel ()
is not implemented.
.SH ATTRIBUTES
For an explanation of the terms used in this section, see
.BR attributes (7).
.TS
allbox;
lbx lb lb
l l l.
Interface	Attribute	Value
T{
.na
.nh
.BR aio_cancel ()
T}	Thread safety	MT-Safe
.TE
.sp 1
.SH STANDARDS
POSIX.1-2008.
.SH HISTORY
glibc 2.1.
POSIX.1-2001.
.SH EXAMPLES
See
.BR aio (7).
.SH SEE ALSO
.BR aio_error (3),
.BR aio_fsync (3),
.BR aio_read (3),
.BR aio_return (3),
.BR aio_suspend (3),
.BR aio_write (3),
.BR lio_listio (3),
.BR aio (7)