aio.h(7POSIX)
๐ธ aio.h โ asynchronous input and output ๐
okay bestie, sit DOWN, because we're talking about aio.h from the POSIX Programmer's Manual (that's the 7POSIX situation, iykyk). It's the header that gives you async I/O, and it's lowkey iconic.
๐ซถ heads up fr fr: this 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 actual Linux behavior), or the interface might not even be implemented on Linux at all. no cap.
โจ SYNOPSIS โจ
#include <aio.h>
๐ฆ DESCRIPTION ๐ฆ
So the <aio.h> header shall define the aiocb structure, and it's gotta include at least these members, okay? Not one less:
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.
Periodt. ๐
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>.
It shall define the struct timespec structure as described in <time.h>. ๐
And it shall define the sigevent structure and the sigval union as described in <signal.h>. โจ
๐ the symbolic constants (the vibe check) ๐
The <aio.h> header shall define the following symbolic constants:
AIO_ALLDONEโ a return value that means none of the requested operations could be canceled, because they're already complete. like, they're done, bestie, nothing to cancel ๐AIO_CANCELEDโ a return value meaning all the requested operations have been canceled. slay.AIO_NOTCANCELEDโ a return value meaning some of the requested operations could not be canceled, since they're in progress. half ate, honestly.LIO_NOPโ alio_listio()element operation option indicating no transfer is requested. literally nothing happening.LIO_NOWAITโ alio_listio()synchronization operation indicating the calling thread is to keep on executing while thelio_listio()operation is being performed, and no notification is given when the operation is complete. main character energy: you do you, we're not telling you when it's done ๐LIO_READโ alio_listio()element operation option requesting a read. ๐LIO_WAITโ alio_listio()synchronization operation indicating the calling thread is to suspend until thelio_listio()operation is complete. hold please ๐งLIO_WRITEโ alio_listio()element operation option requesting a write. โ๏ธ
๐ the functions ๐
The following shall be declared as functions, and they may also be defined as macros. Function prototypes shall be provided. (yes, shall, we're being official about it)
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);
also: including the <aio.h> header may make visible symbols that are defined in the headers <fcntl.h>, <signal.h>, and <time.h>. so like, watch out, surprise symbols ๐ซฃ
๐ The following sections are informative. (translation: the tea is optional, the facts above were the real ones)
๐ APPLICATION USAGE
None.
like. none. nothing. empty. the void. ๐
๐ง RATIONALE
None.
also none bestie, we're keeping it mysterious โจ
๐ฎ FUTURE DIRECTIONS
None.
no plans, no drama, no notes. ๐
๐ SEE ALSO
<fcntl.h><signal.h><sys_types.h><time.h>
And 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() โ the whole friend group, go say hi ๐ธ
๐ COPYRIGHT
Okay so legally I have to tell you this and I'm doing it with love:
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.
And if there's ever 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. it's the final boss, it wins, no arguing ๐ซถ
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 .
๐ okay that's the whole page, you ate that. it's giving informed.
IEEE/The Open Group โ 2017 โ aio.h(7POSIX) ๐ bye bestie, go read something async ๐
๐ฆ 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