compat.libaio
#includeLinux-native asynchronous I/O access library (libaio)
#include <libaio.h>
mcpp add compat.libaio@0.3.113
Usage
From this repository's own test project — built and run by CI, not written for the website.
// Behavioral test: real kernel AIO submissions, not a link check.
//
// Three things can go wrong with this package and none of them is a missing
// symbol.
//
// 1. `struct iocb` is the KERNEL's structure, assembled by libaio.h out of
// PADDED/PADDEDptr/PADDEDul macros chosen by endianness and word size. Get
// that selection wrong and every field lands at the wrong offset — the
// library still links, io_submit still returns 1, and the kernel writes
// the wrong bytes to the wrong place. So the assertions read back what
// actually hit the file.
//
// 2. The plain names `io_getevents` and `io_cancel` do not exist as ordinary
// definitions upstream: the functions are called `io_getevents_0_4` /
// `io_cancel_0_4` and publish the short names through
// `.symver … @@LIBAIO_0.4`. Whether that survives into a consumer's link
// is a linker behavior, so both are called here on purpose.
//
// 3. libaio does NOT use errno. Every wrapper returns `-errno` directly and
// restores the caller's errno, which is the opposite of the convention
// the surrounding POSIX calls follow. The error-path assertion pins that
// down rather than assuming it.
// …
tests/examples/libaio/tests/aio.cpp · project tests/examples/libaio
Build
- targets
aio (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
libaio-0.3.113/mcpp/include
Sources (12)
libaio-0.3.113/src/io_queue_init.clibaio-0.3.113/src/io_queue_release.clibaio-0.3.113/src/io_queue_wait.clibaio-0.3.113/src/io_queue_run.clibaio-0.3.113/src/io_getevents.clibaio-0.3.113/src/io_submit.clibaio-0.3.113/src/io_cancel.clibaio-0.3.113/src/io_setup.clibaio-0.3.113/src/io_destroy.clibaio-0.3.113/src/io_pgetevents.clibaio-0.3.113/src/raw_syscall.clibaio-0.3.113/src/compat-0_1.c
Generated files
libaio-0.3.113/mcpp/include/libaio.h