AIO_ERROR(2)

πŸ’– AIO_ERROR(2) πŸ’–

okay bestie, we're in the System Calls Manual and today's main character is aio_error β€” the little guy who tells you how your async I/O request is doing. no cap, this is a realtime situation. πŸ¦‹


✨ NAME ✨

aio_error β€” retrieve error status of asynchronous I/O operation (REALTIME)

πŸ“š LIBRARY πŸ“š

Standard C Library (libc, -lc)

πŸŽ€ SYNOPSIS πŸŽ€

#include <aio.h>

int
aio_error(const struct aiocb *iocb);

🌸 DESCRIPTION 🌸

so basically, the aio_error() system call returns the error status of the asynchronous I/O request that's associated with the structure pointed to by iocb. that's it. that's the whole vibe. you hand it a pointer, it tells you what's up with your request. πŸ’…

⭐ RETURN VALUES ⭐

okay this is the part where you find out what you got:

  • if your asynchronous I/O request completed successfully, aio_error() returns 0. slay. πŸŽ‰
  • if the request has not yet completed, you get EINPROGRESS. it's giving "not me waiting on my own I/O" energy. ⏳
  • if the request completed unsuccessfully, the error status is returned as described in read(2), write(2), or fsync(2). go look those up, bestie, they have the receipts. πŸ“–
  • and on failure? aio_error() returns -1 and sets errno to indicate the error condition. πŸ’€

πŸ”₯ ERRORS πŸ”₯

the aio_error() system call will fail if:

  • [EINVAL] β€” the iocb argument does not reference an outstanding asynchronous I/O request. like, that pointer isn't pointing at anything currently in flight, bestie. πŸ™ˆ

πŸ‘€ SEE ALSO πŸ‘€

aio_cancel(2), aio_read(2), aio_return(2), aio_suspend(2), aio_write(2), fsync(2), read(2), write(2), aio(4)

🌈 STANDARDS 🌈

the aio_error() system call is expected to conform to the IEEE Std 1003.1 (β€œPOSIX.1”) standard. iconic behavior honestly. πŸ‘‘

πŸ¦‹ HISTORY πŸ¦‹

the aio_error() system call first appeared in FreeBSD 3.0. a true elder. 🌟

πŸ’œ AUTHORS πŸ’œ

this manual page was written by Wes Peters <wes@softweyr.com>. thank you for your service, king. 🫢


and that's the whole page, bestie!! this one came from the Debian crew, dated June 2, 1999, and it lives under AIO_ERROR(2) in the System Calls Manual. go forth and check your async errors, mwah πŸ’–βœ¨

πŸ“¦ where this page comes from