$ man rawapi
Low-level systems programming interface. No abstractions. No magic.
// rawapi_example.c
#include <rawapi/core.h>
#include <rawapi/mem.h>
int main(void) {
raw_ctx_t *ctx = raw_init(RAW_DEFAULT);
raw_buf_t *buf = raw_alloc(ctx, 4096);
raw_write(buf, data, len);
raw_flush(ctx);
raw_destroy(ctx);
return 0;
}
// Core Concepts
Contexts
Every RAWAPI operation requires a context. Contexts manage memory arenas, file descriptors, and signal handlers. A context is thread-local by default; use raw_ctx_share() for cross-thread access with explicit locking.
Buffers
Buffers are fixed-size memory regions allocated from the context arena. They support zero-copy reads, scatter-gather I/O, and automatic alignment to cache-line boundaries. Buffers cannot be resized after allocation.
Pipelines
Chain multiple operations into a pipeline for batch execution. The runtime fuses compatible operations and eliminates intermediate copies. Pipelines are submitted atomically to the kernel via io_uring.
Arenas
Memory arenas provide bump-pointer allocation with O(1) free. Each context owns one arena by default. Arena size is configurable at init time via RAW_ARENA_SIZE. When an arena is exhausted, raw_alloc returns NULL rather than falling back to malloc.
Descriptors
File descriptors are managed through the context. Use raw_open() and raw_close() instead of system calls directly. The context tracks descriptor lifetime and ensures cleanup on raw_destroy(), preventing resource leaks.
// Function Reference
// Error Codes
// Platform Support
Linux
x86_64, aarch64
Kernel 5.10+ (io_uring)
glibc 2.31+, musl
macOS
x86_64, arm64
macOS 13+ (kqueue fallback)
Xcode 14+ toolchain
FreeBSD
x86_64, aarch64
FreeBSD 13+ (kqueue)
Clang 15+ or GCC 12+
// Community
IRC
#rawapi on Libera.Chat. Core maintainers are active daily. Logs available at logs.rawapi.dev.
Mailing List
rawapi-dev@lists.rawapi.dev for patches and RFCs. rawapi-users@ for usage questions and discussion.
Source
git.rawapi.dev/rawapi/core. Mirror on GitHub. Contributions require signed-off-by and passing CI.
$ git clone git://git.rawapi.dev/rawapi/core.git
$ cd core && make && make test
$ sudo make install PREFIX=/usr/local