aio_return(3)
β¨ NAME β¨
ok so bestie, this is aio_return β she gets the return status of an asynchronous I/O operation. that's the whole gig. π
it lives in the Real-time library (librt, -lrt), so like, link her in or she won't show up to the party π
πΈ SYNOPSIS πΈ
#include <aio.h>
ssize_t aio_return(struct aiocb *aiocbp);
she's a one-function girlie, no drama. π¦
π DESCRIPTION π
so basically aio_return() hands you back the final return status of the asynchronous I/O request whose control block is pointed at by aiocbp. (if you wanna know what the aiocb struct even is, go read aio(7), she explains it all. π«Ά)
okay this part is IMPORTANT and not me being extra: call this function only once for any given request. like, one time. afteraio_error(3)returns something that is notEINPROGRESS. that's the vibe check. ifaio_error(3)is still sayingEINPROGRESS... bestie, wait. do not pass go. π
π RETURN VALUE π
if your asynchronous I/O operation has completed, this function returns the exact value that a synchronous read(2), write(2), fsync(2), or fdatasync(2) call would have returned. iconic. it ate and left no crumbs. π
on error, -1 gets returned, and errno is set to tell you which error, so read her.
β οΈ and now for the spooky part: if the asynchronous I/O operation has not yet completed, the return value and the effect of aio_return() are undefined. that's not "probably fine", that's "literally anything could happen". do not test her. π
π ERRORS π
EINVALβaiocbpdoesn't point at a control block for an asynchronous I/O request whose return status hasn't been retrieved yet. i.e. wrong control block, or you already grabbed the status. πENOSYSβaio_return()isn't implemented. she simply isn't there. ghosted. π»
π§ ATTRIBUTES π§
here's the ~lore~ on the terms used in this section, if you need it: see attributes(7).
aio_return()β Thread safety:MT-Safe
so yeah, she's MT-Safe, she can hang with the whole group chat at once. π
β STANDARDS β
POSIX.1-2008. certified. periodt. π
π HISTORY π
glibc 2.1POSIX.1-2001
she's an elder actually, been around since forever and still slaying πΈ
π₯ EXAMPLES π₯
look, examples live over at aio(7). she's got the whole demo. go say hi π«Ά
π SEE ALSO π
aio_cancel(3), aio_error(3), aio_fsync(3), aio_read(3), aio_suspend(3), aio_write(3), lio_listio(3), aio(7)
the whole async I/O friend group, honestly π¦
<div align="center">βΏ mwah βΏ</div>
ok that's the page, bestie!! love u, go call aio_error(3) first π
this was brought to you by Linux man-pages 6.20, dated 2026-02-08 β and this lil rewrite signs off on aio_return(3) πβ¨π
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: GPL-2.0-or-later
- Copyright 2003, Andries E. Brouwer <aeb@cwi.nl>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms