posish provides efficient memory-safe and I/O-safe wrappers to
libc APIs and syscalls.
The wrappers perform the following tasks:
- Error values are translated to
- Buffers are passed as Rust slices.
- Out-parameters are presented as return values.
- Path arguments use
Arg, so they accept any string type.
- File descriptors are passed and returned via
OwnedFdinstead of bare integers, ensuring I/O safety.
- Constants use
- Multiplexed functions (eg.
ioctl, etc.) are de-multiplexed.
- Variadic functions (eg.
openat, etc.) are presented as non-variadic.
- Functions and types which need
64suffixes to enable large-file support are used automatically, and file sizes and offsets are presented as
- Behaviors that depend on the sizes of C types like
- In some places, more human-friendly and less historical-accident names are used.
Things they don’t do include:
- Detecting whether functions are supported at runtime.
- Hiding significant differences between platforms.
- Restricting ambient authorities.
- Imposing sandboxing features such as filesystem path or network address sandboxing.
pub use io_lifetimes;