aio_error(3)

✨ aio_error(3) ✨

okay bestie, so this one's from the Library Functions Manual, and it's literally the vibe check for your async I/O πŸ¦‹


πŸ’– NAME πŸ’–

aio_error β€” get error status of asynchronous I/O operation


🌸 LIBRARY 🌸

Real-time library (librt, -lrt)


πŸŽ€ SYNOPSIS πŸŽ€

#include <aio.h>

int aio_error(const struct aiocb *aiocbp);

πŸ’… DESCRIPTION πŸ’…

So basically, aio_error() returns the error status for the asynchronous I/O request whose control block is pointed to by aiocbp. That's it, that's the whole job. She's simple, she's iconic, she serves πŸ‘‘

(if you're like "bestie what even IS an aiocb struct" β€” go read aio(7), it's all laid out there, no cap)


🌈 RETURN VALUE 🌈

This function hands you back one of these, and every single one matters:

  • EINPROGRESS β€” the request has not been completed yet. it's still cooking πŸ“
  • ECANCELED β€” the request was canceled. rip πŸͺ¦
  • 0 β€” the request completed successfully. slay!! ✨
  • > 0 β€” a positive error number if the asynchronous I/O operation failed. and this is the exact same value that would have been stored in the errno variable in the case of a synchronous read(2), write(2), fsync(2), or fdatasync(2) call. same number, different door πŸšͺ

⭐ ERRORS ⭐

  • EINVAL β€” aiocbp does not point at a control block for an asynchronous I/O request of which the return status (see aio_return(3)) has not been retrieved yet. like, that's not the girl you're looking for πŸ™ˆ
  • ENOSYS β€” aio_error() is not implemented. she's not even here, she never showed up πŸ’€

πŸ‘‘ ATTRIBUTES πŸ‘‘

For an explanation of the terms used in this section, see attributes(7).

  • Interface: aio_error()
  • Attribute: Thread safety
  • Value: MT-Safe

(MT-Safe means you can call her from multiple threads and she will NOT start drama 🫢)


🧚 STANDARDS 🧚

POSIX.1-2008.


πŸ’œ HISTORY πŸ’œ

  • glibc 2.1.
  • POSIX.1-2001.

she's been around. a legend. a veteran. respect her πŸ’…


🌸 EXAMPLES 🌸

See aio(7).


πŸ¦‹ SEE ALSO πŸ¦‹

aio_cancel(3), aio_fsync(3), aio_read(3), aio_return(3), aio_suspend(3), aio_write(3), lio_listio(3), aio(7)


and that's the whole page, bestie!! this one shipped in Linux man-pages 6.20, dated 2026-02-08 β€” so go forth, check your async errors, and stay iconic πŸ’–βœ¨πŸŽ€

πŸ“¦ 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