AIO_ERROR(3P)

πŸ’– AIO_ERROR(3P) β€” POSIX Programmer's Manual πŸ’–

okay bestie, welcome to aio_error from the POSIX Programmer's Manual, no cap 🫢

✨ PROLOG ✨

so like, heads up first: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β€” so if you're on Linux, go consult the corresponding Linux manual page for the deets on how Linux actually behaves β€” or honestly, the interface may not even be implemented on Linux at all. vibe check passed? good, let's go πŸ’…


🌸 NAME 🌸

aio_error β€” retrieve errors status for an asynchronous I/O operation

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <aio.h>

int aio_error(const struct aiocb *aiocbp);

πŸ’œ DESCRIPTION πŸ’œ

okay so the aio_error() function shall return the error status associated with the aiocb structure referenced by the aiocbp argument. that's the whole main character move. ✨

and like, what even is that error status? it's the errno value that would be set by the corresponding read(), write(), fdatasync(), or fsync() operation. yes bestie, it's literally borrowing errno's whole thing.

if the operation has not yet completed, then the error status shall be equal to [EINPROGRESS]. she's still cooking πŸ”₯

🚨 okay important one: if the aiocb structure pointed to by aiocbp is not associated with an operation that has been scheduled, the results are undefined. that's not a cute mysterious vibe, that's undefined behaviour, periodt. don't do it.

πŸŽ€ RETURN VALUE πŸŽ€

  • if the asynchronous I/O operation has completed successfully β†’ 0 shall be returned ✨
  • if the asynchronous operation has completed unsuccessfully β†’ the error status, as described for read(), write(), fdatasync(), and fsync(), shall be returned 😭
  • if the asynchronous I/O operation has not yet completed β†’ [EINPROGRESS] shall be returned πŸ’€

and if the aio_error() function itself fails? it shall return -1 and set errno to indicate the error. yeah, she can fail too, she's not immune πŸ™ˆ

🌈 ERRORS 🌈

the aio_error() function may fail if:

  • EINVAL β€” the aiocbp argument does not refer to an asynchronous operation whose return status has not yet been retrieved.
πŸ’‘ the following sections are informative. (translation: they're the bonus content, not the rules πŸ‘‘)

πŸ“ EXAMPLES πŸ“

None.

🧚 APPLICATION USAGE 🧚

None.

⭐ RATIONALE ⭐

None.

🌟 FUTURE DIRECTIONS 🌟

None.

πŸ‘‘ SEE ALSO πŸ‘‘

aio_cancel(), aio_fsync(), aio_read(), aio_return(), aio_write(), close(), exec, exit(), fork(), lio_listio(), lseek(), read()

the Base Definitions volume of POSIX.1‐2017, <aio.h> πŸ“š

portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group.

in the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. (she said what she said β€” the original is the final boss πŸ‘‘)

the original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. to report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


that's the whole page bestie, every last bit of it πŸ’– this one's brought to you by IEEE/The Open Group, 2017 β€” yeah, 2017, she's vintage and she's still iconic πŸŽ€βœ¨

πŸ“¦ where this page comes from