54 releases (16 breaking)
|new 0.16.4||Jul 21, 2021|
|0.15.5||Jul 6, 2021|
|0.6.1||Mar 2, 2021|
|0.5.2||Dec 8, 2020|
|0.4.1||Oct 27, 2020|
#21 in Unix APIs
9,417 downloads per month
Used in 36 crates (14 directly)
Safe Rust bindings to POSIX-ish libc APIs and syscalls
A Bytecode Alliance project
posish provides efficient memory-safe and I/O-safe wrappers to "POSIX-ish"
libc APIs and syscalls, with configurable backends. It uses Rust references,
slices, and return values instead of raw pointers, and
of raw file descriptors, providing memory safety and I/O safety. It uses
Results for reporting errors,
bitflags instead of bare integer flags,
Arg trait with optimizations to efficiently accept any Rust string type,
and several other efficient conveniences.
Posish currently has two backends available:
linux_raw backend is enabled by default on Linux on x86-64, x86, aarch64,
and riscv64gc, and uses raw Linux system calls and vDSO calls. It supports
stable as well as nightly Rust.
- By being implemented entirely in Rust, avoiding
errno, and pthread cancellation, and employing some specialized optimizations, most functions compile down to very efficient code. On nightly Rust, they can often be fully inlined into user code.
- Most functions in
linux_rawpreserve memory and I/O safety all the way down to the syscalls.
linux_rawuses a 64-bit
time_ttype on all platforms, avoiding the y2038 bug.
libc backend is enabled by default on all other platforms, and can be
explicitly for any target by setting
It uses the
libc crate which provides bindings to native
and is portable to many OS's.