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. after aio_error(3) returns something that is not EINPROGRESS. that's the vibe check. if aio_error(3) is still saying EINPROGRESS... 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 β€” aiocbp doesn'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.1
  • POSIX.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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms