Safe Rust bindings to POSIX/Unix/Linux/Winsock syscalls with memory safety, I/O safety, and configurable backends.
rustix is a low-level Rust library that provides memory-safe and I/O-safe wrappers for POSIX-like, Unix-like, Linux, and Winsock system call APIs. It replaces raw pointers and file descriptors with Rust references, slices, and I/O safety types to ensure memory safety, I/O safety, and pointer provenance. It is designed as a foundational layer for building higher-level portable APIs.
Rust developers building low-level system software, such as operating system components, embedded systems, or high-performance libraries that require direct, safe interaction with kernel syscalls. It is also suitable for developers creating cross-platform abstractions over Unix and Windows networking APIs.
Developers choose rustix for its strong safety guarantees, configurable backends (including direct Linux syscalls via linux_raw for performance and libc for portability), and idiomatic Rust interfaces that eliminate common pitfalls like raw pointer misuse. Its focus on I/O safety and provenance sets it apart from similar crates.
Safe Rust bindings to POSIX-ish APIs
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Rust references, slices, and I/O safety types like OwnedFd instead of raw pointers and file descriptors, eliminating common vulnerabilities while preserving provenance.
Offers linux_raw for direct syscalls on Linux for performance, and libc for portability across Unix-like systems and Windows networking via Winsock.
Employs Result for errors, bitflags for flags, and an optimized Arg trait for string handling, compiling down to inlined code with minimal overhead.
Covers filesystem, network, process, thread, time, and memory operations with feature-gated modules, allowing selective inclusion based on project needs.
Automatically uses 64-bit APIs to avoid LFS and y2038 issues on 32-bit platforms, ensuring long-term compatibility without manual adjustments.
Only the net API supports Windows via Winsock; other system calls are not available, making it unsuitable for comprehensive cross-platform development outside networking.
Users must manually handle errors like NOSYS when using newer syscalls on older kernels, adding complexity for adaptive code in heterogeneous environments.
API modules are controlled by Cargo features, and backends require configuration (e.g., use-libc flag), which can complicate build setups and increase maintenance overhead.