AIO_CANCEL(3POSIX)
๐ซถ aio_cancel ๐ซถ
okay so bestie, welcome to aio_cancel ๐
this page comes straight outta the POSIX Programmer's Manual, section 3POSIX, and it's literally all about canceling asynchronous I/O requests. grab a snack, we're doing this ๐ธ
โจ PROLOG โจ
first things first, the fine print that we do not skip: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ โ so consult the corresponding Linux manual page for the details on Linux behavior, fr fr. orโฆ the interface may not be implemented on Linux at all ๐ so vibe check before you commit, bestie.
๐ NAME ๐
aio_cancel โ cancel an asynchronous I/O request. that's it, that's the whole thing, iconic ๐
๐ SYNOPSIS ๐
#include <aio.h>
int aio_cancel(int fildes, struct aiocb *aiocbp);
๐ฆ DESCRIPTION ๐ฆ
so here's the tea ๐ the aio_cancel() function shall attempt to cancel one or more asynchronous I/O requests that are currently outstanding against the file descriptor fildes. note the word attempt, bestie โ it's giving "we'll try" not "we'll guarantee" ๐ญ
the aiocbp argument points to the asynchronous I/O control block for one particular request that you want canceled. and if aiocbp is NULL? then all outstanding cancelable asynchronous I/O requests against fildes shall be canceled. we're going full scorched earth, no survivors ๐ฅ
normal asynchronous notification shall occur for the asynchronous I/O operations that get successfully canceled. and if there are requests that cannot be canceled? then the normal asynchronous completion process shall take place for those requests when they are completed. they finish their little journey, we just don't get to stop it ๐ง
for requested operations that are successfully canceled, the associated error status shall be set to [ECANCELED] and the return status shall be -1. for requested operations that are not successfully canceled, the aiocbp shall not be modified by aio_cancel(). hands off, no touchy ๐
now, if aiocbp is not NULL, and fildes does not have the same value as the file descriptor with which the asynchronous operation was initiated โ unspecified results occur. that's the scary sentence. that's the one where the standard just shrugs at you ๐ don't do that.
and the big one: which operations are cancelable is implementation-defined. so it depends on your implementation, periodt.
๐ RETURN VALUE ๐
here's what you get back, bestie:
AIO_CANCELEDโ the requested operation(s) were canceled. slay ๐AIO_NOTCANCELEDโ returned if at least one of the requested operation(s) cannot be canceled because it is in progress. and no, the state of the other operations (if any) referenced in the call toaio_cancel()is not indicated by the return value ofaio_cancel(). rude, honestly. the application may determine the state of affairs for these operations by usingaio_error(). so like, ask the other function, iykyk.AIO_ALLDONEโ returned if all of the operations have already completed. nothing left to cancel, it's over, the girls have gone home ๐- otherwise, the function shall return
-1and seterrnoto indicate the error.
๐จ ERRORS ๐จ
the aio_cancel() function shall fail if:
EBADFโ thefildesargument is not a valid file descriptor. like bestie, that's not a real file descriptor, please ๐ญ
heads up: the following sections are informative. (that's what the standard says, we're just relaying the message ๐)
๐ธ EXAMPLES ๐ธ
None. literally nothing here, bestie ๐
๐ APPLICATION USAGE ๐
None. again, nothing. the page is being mysterious โจ
๐ง RATIONALE ๐ง
None. no thoughts, head empty ๐ญ
๐ฎ FUTURE DIRECTIONS ๐ฎ
None. the future is unwritten, queen ๐
๐ซถ SEE ALSO ๐ซถ
aio_read()aio_write()- The Base Definitions volume of POSIX.1โ2017,
<aio.h>
๐ COPYRIGHT ๐
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
okay that's the whole page, bestie, we ate and left no crumbs ๐
this came to you courtesy of IEEE/The Open Group, 2017, and the page itself is AIO_CANCEL(3POSIX) โ go cancel something (safely), mwah ๐ฉทโจ
๐ฆ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 ยท Other
- debian trixie: manpages-posix-dev 2017a-2 ยท Other
- ubuntu jammy: manpages-posix-dev 2017a-2 ยท Other
- ubuntu noble: manpages-posix-dev 2017a-2 ยท Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 ยท Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 ยท Other
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms