# nosv-sys
`nosv-sys` provides raw Rust FFI bindings to the nOS-V C API. It is intended to
be the dependency boundary for the safe [`nosv`](https://github.com/Orkking2/nosv)
crate, not the place where Rust ownership, task-context, or lifetime guarantees
are modeled.
All nOS-V functions exposed by this crate are unsafe to use directly. Callers
must uphold the invariants documented by the nOS-V headers, including runtime
initialization, task-context restrictions, callback validity, pointer validity,
and handle ownership.
## Requirements
- nOS-V 4.1.0 or newer.
- `pkg-config`.
- A C toolchain and `libclang` usable by `bindgen`.
- `PKG_CONFIG_PATH` set to a directory containing `nos-v.pc` when nOS-V is not
installed in a default pkg-config search path, see [`config.toml.example`](/.cargo/config.toml.example).
For a local nOS-V checkout, `PKG_CONFIG_PATH` commonly points at either the
checkout root containing `nos-v.pc` or the installed prefix's `lib/pkgconfig`
directory.
## Scope
This crate deliberately exposes:
- bindgen-generated raw types and functions from `nosv.h`, `nosv/affinity.h`,
`nosv/compat.h`, `nosv/hwinfo.h`, and `nosv/memory.h`;
- C-like aliases for nOS-V enum constants;
- manual translations of nOS-V flag macros that bindgen does not emit.
This crate deliberately does not expose:
- RAII runtime initialization;
- owned task or task-type handles;
- task-context tokens;
- Rust closure trampolines;
- safe synchronization wrappers.
For a safe, higher-level API built on top of this crate, use
[`nosv`](https://github.com/Orkking2/nosv).
## Safe `nosv` Crate
The [`nosv`](https://github.com/Orkking2/nosv) crate provides a safe,
futures-based Rust runtime over these bindings. It models nOS-V ownership and
context rules in Rust types and provides high-level task, topology, affinity,
memory, timer, and I/O APIs.