aio.h(0P)
πΈ aio.h β the POSIX Programmer's Manual tea, bestie edition π
okay so first things first, hi, welcome, you're reading aio.h(0P) from the POSIX Programmer's Manual and honestly? iconic header, no notes. π
π«§ PROLOG
so like, real talk before we get into it: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so go check the corresponding Linux manual page for the deets on Linux behavior, fr fr), or the interface might not even be implemented on Linux at all. π just a heads up, don't come for me.
β¨ NAME β¨
aio.h β asynchronous input and output. that's it. that's the whole vibe. asynchronous I/O, but make it a header file. π¦
π SYNOPSIS
#include <aio.h>
literally one line. we love a low-maintenance queen. π
π DESCRIPTION π
okay so here's where it gets juicy. The <aio.h> header shall define the aiocb structure, and that structure shall include at least these members (yes, at least, so there could be more, don't @ me):
int aio_fildes File descriptor.
off_t aio_offset File offset.
volatile void *aio_buf Location of buffer.
size_t aio_nbytes Length of transfer.
int aio_reqprio Request priority offset.
struct sigevent aio_sigevent Signal number and value.
int aio_lio_opcode Operation to be performed.
look at her. every single field accounted for. π
The <aio.h> header shall also define the off_t, pthread_attr_t, size_t, and ssize_t types, exactly as described in <sys/types.h>. borrowing from the neighbors, we love to see it.
The <aio.h> header shall define the struct timespec structure as described in <time.h>.
The <aio.h> header shall define the sigevent structure and the sigval union as described in <signal.h>.
π§ the symbolic constants (a whole squad)
The <aio.h> header shall define the following symbolic constants, and bestie, there are eight of them, so buckle up:
AIO_ALLDONEβ a return value meaning none of the requested operations could be canceled because they're already complete. too late, they ate. πAIO_CANCELEDβ a return value meaning all the requested operations have been canceled. slay, mission accomplished. β¨AIO_NOTCANCELEDβ a return value meaning some of the requested operations could not be canceled because they are in progress. partial slay. mid. πLIO_NOPβ alio_listio()element operation option indicating that no transfer is requested. she's just standing there. standing there MENACINGLY.LIO_NOWAITβ alio_listio()synchronization operation indicating that the calling thread is to continue execution while thelio_listio()operation is being performed, and no notification is given when the operation is complete. ghosting, but legally.LIO_READβ alio_listio()element operation option requesting a read.LIO_WAITβ alio_listio()synchronization operation indicating that the calling thread is to suspend until thelio_listio()operation is complete. she waits. patiently. πLIO_WRITEβ alio_listio()element operation option requesting a write.
π the functions
The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided. (so don't be shocked if your fave is secretly a macro, iykyk.)
int aio_cancel(int, struct aiocb *);
int aio_error(const struct aiocb *);
int aio_fsync(int, struct aiocb *);
int aio_read(struct aiocb *);
ssize_t aio_return(struct aiocb *);
int aio_suspend(const struct aiocb *const [], int,
const struct timespec *);
int aio_write(struct aiocb *);
int lio_listio(int, struct aiocb *restrict const [restrict], int,
struct sigevent *restrict);
copy that exactly, character for character, bestie. the restrict keywords are not decorative, they're the moment. π₯
also lowkey important: inclusion of the<aio.h>header may make visible symbols defined in the headers<fcntl.h>,<signal.h>, and<time.h>. surprise guests at the function. π
The following sections are informative. (translation: not normative, just chatting.)
πΈ APPLICATION USAGE
None.
she said nothing. silence. a mood. π€
π¦ RATIONALE
None.
also nothing! two for two! the restraint is honestly impressive. π
β FUTURE DIRECTIONS
None.
no future plans. living in the present. main character energy. π
π₯ SEE ALSO
<fcntl.h>,<signal.h>,<sys_types.h>,<time.h>
and from the System Interfaces volume of POSIX.1β2017:
aio_cancel(),aio_error(),aio_fsync(),aio_read(),aio_return(),aio_suspend(),aio_write(),fsync(),lio_listio(),lseek(),read(),write()
go read those too, they're all connected, it's a whole cinematic universe. π¬
π COPYRIGHT
okay this part is the serious part so let me be real with you:
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 was brought to you by IEEE/The Open Group, 2017 β aka the aio.h(0P) footer girlies β mwah, take care of her, she's asynchronous and she's thriving β¨π«Ά
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- 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-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms