AIO_ERROR(3POSIX)
π AIO_ERROR(3POSIX) π
okay so bestie, welcome to the POSIX Programmer's Manual π
this one's aio_error from section 3POSIX, and it's genuinely one of the cutest little calls in the async I/O family. let's get into it π¦
πΈ PROLOG πΈ
so like, real talk 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, pls go consult the corresponding Linux manual page for the deets on Linux behavior), or honestly the interface may not even be implemented on Linux at all. no cap. π
β¨ NAME β¨
aio_error β retrieve errors status for an asynchronous I/O operation
π SYNOPSIS π
#include <aio.h>
int aio_error(const struct aiocb *aiocbp);
π« DESCRIPTION π«
so here's the vibe: the aio_error() function shall return the error status associated with the aiocb structure referenced by the aiocbp argument. π«Ά
and what even is the error status for an async I/O operation, you ask? it's the errno value that would be set by the corresponding read(), write(), fdatasync(), or fsync() operation. like, it's literally the same energy, just delivered async. if the operation has not yet completed, then the error status shall be equal to [EINPROGRESS]. β³
β οΈ okay and this part is important: if theaiocbstructure pointed to byaiocbpis not associated with an operation that has been scheduled, the results are undefined. undefined behavior is not a slay, it's a π. don't do it.
π₯ RETURN VALUE π₯
- if the asynchronous I/O operation has completed successfully β
0shall be returned. we love a clean zero. β¨ - if the asynchronous operation has completed unsuccessfully β the error status shall be returned, as described for
read(),write(),fdatasync(), andfsync(). π - if the asynchronous I/O operation has not yet completed β
[EINPROGRESS]shall be returned. she's still cooking π
and if the aio_error() function itself fails, it shall return -1 and set errno to indicate the error. classic.
π ERRORS π
the aio_error() function may fail if:
EINVALβ theaiocbpargument does not refer to an asynchronous operation whose return status has not yet been retrieved.
and that's it, that's the whole list, she's a short queen π
the following sections are informative. (iykyk, informative means it's not the normative rules, it's the β¨ lore β¨)
π§ EXAMPLES π§
None.
like literally none. iconic minimalism. π
πΈ 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()
and the Base Definitions volume of POSIX.1β2017, <aio.h> π
π COPYRIGHT π
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. 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 .
and that's the whole page bestie!! π«Ά this one came to you courtesy of IEEE/The Open Group, dated 2017, and it lives in the 3POSIX manual. go forth and check your async errors, main character πβ¨
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms