AIO_CANCEL(2)
β¨ AIO_CANCEL π
β the aio_cancel system call, from the System Calls Manual
okay bestie, buckle up π this is aio_cancel(2), and it's here to β¨ cancel an outstanding asynchronous I/O operation (REALTIME) β¨. yes, REALTIME. that's the vibe.
π LIBRARY
Standard C Library (libc, -lc) π«Ά
πΈ SYNOPSIS
#include <aio.h>
int
aio_cancel(int fildes, struct aiocb *iocb);
π DESCRIPTION
so the aio_cancel() system call does exactly what it says on the tin, no cap: it cancels the outstanding asynchronous I/O request for the file descriptor you passed in as fildes. iconic behaviour, honestly.
and if you also hand it an iocb? then it's picky β only that specific asynchronous I/O request gets cancelled. main character energy, it knows what it wants. π
Normal asynchronous notification occurs for cancelled requests β so like, the notification system still does its thing, don't worry. and those requests complete with an error result of ECANCELED. so yeah, they end, but they end sad. π
π§ RESTRICTIONS
okay lowkey important, listen up:
The aio_cancel() system call does not cancel asynchronous I/O requests for raw disk devices. nope. not happening. not today. π
The aio_cancel() system call will always return AIO_NOTCANCELED for file descriptors associated with raw disk devices. always. every single time. it's giving "we said no."
π RETURN VALUES
The aio_cancel() system call returns -1 to indicate an error, or one of the following:
[AIO_CANCELED]β all outstanding requests meeting the criteria specified were cancelled. slay, we ate. π β¨[AIO_NOTCANCELED]β some requests were not cancelled, status for the requests should be checked withaio_error(2). so go check, bestie, don't just sit there π«Ά[AIO_ALLDONE]β all of the requests meeting the criteria have finished. like, they were already done before you even asked. awkward but okay π
π ERRORS
An error return from aio_cancel() indicates:
[EBADF]β thefildesargument is an invalid file descriptor. bestie that fd is not real, that fd is a ghost π»
π SEE ALSO
aio_error(2), aio_read(2), aio_return(2), aio_suspend(2), aio_write(2), aio(4) β the whole friend group, go read them all π
π STANDARDS
The aio_cancel() system call is expected to conform to the IEEE Std 1003.1 (βPOSIX.1β) standard. certified, official, legit, no cap. β
π¦ HISTORY
The aio_cancel() system call first appeared in FreeBSD 3.0. The first functional implementation of aio_cancel() appeared in FreeBSD 4.0. so like, it existed, then it actually existed. character development. πΈ
π AUTHORS
This manual page was originally written by Wes Peters <wes@softweyr.com>. Christopher M Sedore <cmsedore@maxwell.syr.edu> updated it when aio_cancel() was implemented for FreeBSD 4.0. legends, both of them, we stan π
and that's the whole page, bestie!! this one's from the Debian crew, dated January 19, 2000, and it lives in section 2 of the manual (AIO_CANCEL(2)). go cancel something (responsibly) πβ¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1999 Softweyr LLC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms