oconnor663 / os_pipe.rs

a cross-platform library for opening OS pipes in Rust
MIT License
98 stars 16 forks source link

Use rustix instead of libc in the Unix backend #31

Open notgull opened 4 months ago

notgull commented 4 months ago

rustix is a crate that provides an interface to system functions on Unix-like operating systems. It is a wrapper around Linux syscalls on Linux and libc on other operating systems. In addition to being safer, since it uses direct syscalls it reduces instruction counts on Linux.

This commit replaces usages of libc with rustix. In addition to removing all unsafe code from the unix backend, it should also speed it up a little on Linux. Note that this bumps the MSRV of this crate to v1.63. This makes the "io-safety" feature useless, so I've made it an empty feature.

notgull commented 4 months ago

@oconnor663 Any chance you can take a look at this?