AIO_CANCEL(2)
π AIO_CANCEL π (like, the System Calls Manual, bestie β¨)
Okay so before we even get into it β this whole page lives in the System Calls Manual section, and we're about to talk about cancelling async I/O. Try to stay calm. π«Ά
β¨ NAME β¨
aio_cancel β cancel an outstanding asynchronous I/O operation (and yes it's REALTIME, no cap) π
π LIBRARY π
Standard C Library (libc, -lc). Your girl's been hanging out there. π¦
πΈ SYNOPSIS πΈ
#include <aio.h>
int
aio_cancel(int fildes, struct aiocb *iocb);
That's it. That's the whole signature. Obsessed. π
π DESCRIPTION π
So the aio_cancel() system call does exactly what it says on the tin: it cancels the outstanding asynchronous I/O request for the file descriptor you passed in fildes. Main character energy fr. π
And if you also specify iocb? Then it only cancels that specific asynchronous I/O request. Like, super targeted. Not me being picky, just being precise. π―
Normal asynchronous notification still occurs for cancelled requests (the system doesn't ghost you, it tells you what happened π«Ά), and those requests complete with an error result of ECANCELED.
π RESTRICTIONS π (read this part, bestie)
The aio_cancel() system call does not cancel asynchronous I/O requests for raw disk devices. Like, at all. π
And for file descriptors associated with raw disk devices?aio_cancel()will always returnAIO_NOTCANCELED. Every time. No exceptions. It's giving "the vibes are immovable." π
π₯ RETURN VALUES π₯
So aio_cancel() returns -1 to indicate an error, or one of these iconic little values:
[AIO_CANCELED]β All outstanding requests meeting the criteria specified were cancelled. Slay. β¨[AIO_NOTCANCELED]β Some requests were not cancelled (rude), so you should check the status for those requests withaio_error(2). Go check, bestie, don't just assume. π[AIO_ALLDONE]β All of the requests meeting the criteria have already finished. Like, they're done-done. Periodt. π
πΊ ERRORS πΊ
When aio_cancel() returns an error, it's telling you:
[EBADF]β Thefildesargument is an invalid file descriptor. Babe, that fd is not real. Check it. π
π¦ SEE ALSO π¦
Go read these next, they're all part of the same universe:
iykyk π
β STANDARDS β
The aio_cancel() system call is expected to conform to the IEEE Std 1003.1 (βPOSIX.1β) standard. So like, it's official official. π
π§ HISTORY π§
The aio_cancel() system call first appeared in FreeBSD 3.0. Then the first functional implementation of aio_cancel() appeared in FreeBSD 4.0. So the glow-up was real. β¨
π AUTHORS π
This manual page was originally written by Wes Peters <wes@softweyr.com>. And Christopher M Sedore <cmsedore@maxwell.syr.edu> updated it when aio_cancel() was implemented for FreeBSD 4.0. Legends, honestly. π
Okay bye bestie, go cancel some async I/O (except on raw disk devices, you know the vibes now) β this page is from Debian, dated January 19, 2000, from the System Calls Manual, and it ate. π β¨π¦
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 1999 Softweyr LLC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms