Repository navigation
mknod: replace nix::sys::stat with rustix - #12321
mattsu2020 wants to merge 4 commits into
Conversation
|
GNU testsuite comparison: |
Merging this PR will regress 1 benchmark
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
|
|
Thanks for the suggestion! You're right |
|
Is it able to open a PR on rustix to support |
I created the PR, but there are some errors on the Rustix side during CI, so I'll review the code again once the fixes are complete. |
|
Thankyou |
|
Depends on bytecodealliance/rustix#1691. |
|
Compiles successfully on Redox: cargo check -q -p uu_mknod --target x86_64-unknown-redox |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Replace `nix::sys::stat` usage with `rustix::fs` types and `libc::mknod`: - `nix::sys::stat::Mode` → `rustix::fs::Mode` - `nix::sys::stat::SFlag` → `rustix::fs::FileType` - `nix::sys::stat::umask` → `rustix::process::umask` with RAII `UmaskGuard` - `nix::sys::stat::mknod` → `libc::mknod` (rustix::fs::mknodat is unavailable on apple targets) - `nix::libc::S_I*` constants → `0o666` literal The `UmaskGuard` pattern (borrowed from mkdir) ensures umask is restored on drop, even on panic — an improvement over the previous manual save/restore.
- Rename `to_rustix` → `to_file_type` to avoid embedding crate name - Use `let _ = writeln!(stderr, ...)` to prevent SIGABRT on /dev/full - Sort Cargo.toml dependencies alphabetically (libc before rustix)
afe71e6 to
9ddd0cf
Compare
|
@mattsu2020 Please add |
Summary
nix::sys::statinmknodwithrustix.rustix::fs::mknodat,Mode,FileType, andrustix::process::umask.nixdependency.mknodpermissions and umask handling.Depends on bytecodealliance/rustix#1625