Crate rsix[−][src]
Expand description
rsix provides efficient memory-safe and I/O-safe wrappers to
POSIX-like, Unix-like, and Linux syscalls.
The wrappers perform the following tasks:
- Error values are translated to
Results. - 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
AsFdandOwnedFdinstead of bare integers, ensuring I/O safety. - Constants use
enums andbitflagstypes. - Multiplexed functions (eg.
fcntl,ioctl, etc.) are de-multiplexed. - Variadic functions (eg.
openat, etc.) are presented as non-variadic. - Functions and types which need
lprefixes or64suffixes to enable large-file support are used automatically, and file sizes and offsets are presented asi64andu64. - Behaviors that depend on the sizes of C types like
longare hidden. - 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.
See cap-std, system-interface, and io-streams for libraries
which do hide significant differences between platforms, and cap-std
which does perform sandboxing and restricts ambient authorities.
Re-exports
pub use io_lifetimes;