Debian Codegraph @

upstream/debian-trixie/man3/aio_cancel.3

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