API overview
This page maps the stable public surface in include/llam/runtime.h,
include/llam/scope.h (ABI 2.5+), include/llam/executor.h (ABI 2.6+),
include/llam/io.h, include/llam/managed.h, and include/llam/platform.h. Use it to find the right API
group quickly, then check Options and ABI contract
when you need field-level or binary-compatibility rules.
On this page
-
Create, run, stop, and destroy runtimes.
-
Spawn, join, results, groups, and task-local values.
-
Short no-preemption regions and shared local executors.
-
Owned scopes and typed outcomes
Owned inputs, independent futures, and cancellation-safe drain.
-
Clocks, sleeps, timers, signals, and cancellation tokens.
-
Mutexes, reader-writer locks, condition variables, channels, and select.
-
Streams, sockets, owned buffers, and files.
-
Foreign blocking calls, stats, and dumps.
Contracts
| Contract | Rule |
|---|---|
| Deadlines | Absolute deadlines use llam_now_ns() units. 0 means already expired unless the function documents another meaning. |
| Errors | Functions returning -1 set errno; common values include EINVAL, EAGAIN, ETIMEDOUT, ECANCELED, EPIPE, EBUSY, EXDEV, ENOTSUP, and ENOMEM. |
| Runtime ownership | Runtime-aware objects are bound to the runtime that created them. Cross-runtime managed use fails with EXDEV. |
| ABI-sized structs | Use a matching *_opts_init() helper where provided and pass *_CURRENT_SIZE. Windows async opt-in deliberately has no initializer that could silently acknowledge process-wide fail-fast. |
| Nullable payloads | Channel and blocking APIs with _result suffix distinguish a successful NULL payload from failure. |
| Windows files | llam_fd_t is a socket on Windows. Use HANDLE APIs for file and pipe I/O. |
ABI and versioning
llam_abi_versionReturn packed public ABI version. Dynamic loaders should resolve this first.
uint32_t llam_abi_version(void);Return the packed public ABI version implemented by this library. Language runtimes that load LLAM dynamically should resolve this symbol first and require a matching LLAM_ABI_VERSION_MAJOR before calling other symbols.
Returns Packed version `(major << 16) | minor`.
llam_version_stringReturn the static source/API version string.
const char *llam_version_string(void);Return the static LLAM source/API version string.
Returns String owned by the library and valid while its module remains loaded.
llam_abi_get_infoFill version, platform, and struct-size metadata for loaders and bindings.
int llam_abi_get_info(llam_abi_info_t *info, size_t info_size);Fill ABI metadata for dynamic loaders and FFI bindings.
info- Destination metadata struct.
info_size- Size of the caller's
llam_abi_info_tdefinition.
Returns 0 on success, -1 with errno set on invalid arguments.
LLAM_ABI_INFO_CURRENT_SIZESize token for llam_abi_get_info.
#define LLAM_ABI_INFO_CURRENT_SIZECurrent size to pass to llam_abi_get_info.
LLAM_VERSION_*Compile-time source and ABI version macros.LLAM_ABI_VERSION_*Compile-time source and ABI version macros.