nix
nix copied to clipboard
Rust friendly bindings to *nix APIs
## What does this PR do `fanotify` returns events with the fd set to `FAN_NOFD` when the queue overflows. Trying to close it panics with `EBADF`, so don't bother. ##...
If the cmsg buffer is too small, MSG_CTRUNC will be set in the header flags. This should be checked before returning `CmsgIterator`, or else the iterator might return invalid data.
As described in this [comment](https://github.com/nix-rust/nix/issues/2319#issuecomment-1967988916), all the Nix wrapper types should be: 1. `#[repr(transparent)]` 2. `impl From for Wrapper` 3. `impl From for libc::xx`
## What does this PR do This PR adds a `impl From for LinkAddr` to help users of nix avoid `unsafe` code. See https://github.com/nix-rust/nix/issues/2059#issuecomment-1878463448 for reference. ## Checklist: - [x]...
## What does this PR do ## Checklist: - [x] I have read `CONTRIBUTING.md` - [x] I have written necessary tests and rustdoc comments - [x] A change log has...
Whenever we raise the MSRV to 1.77.0 for any reason, we should [ ] Replace the memoffset::offset_of! macro with the builtin macro of the same name (https://blog.rust-lang.org/2024/03/21/Rust-1.77.0.html#offset_of) [ ] Use...
## What does this PR do Adds an implementation of `FromIterator` and `From` for `FdSet`, allowing them to be constructed from iterables of types that implement `AsFd`. ## Checklist: -...
#2170 deprecated `flock` and replaced it with a `Flock` struct, allowing for automatic unlock-on-drop behaviour. So far, so good, but I think there are several ways in which `flock` can...
CI log: https://github.com/nix-rust/nix/actions/runs/8306056722/job/22733675051 ``` failures: ---- sys::test_signal::test_sigsuspend stdout ---- thread '' panicked at 'assertion failed: SIGNAL_RECIEVED.load(Ordering::SeqCst)', test/sys/test_signal.rs:386:9 thread 'sys::test_signal::test_sigsuspend' panicked at 'called `Result::unwrap()` on an `Err` value: Any { .....
Currently we need something like: ``` let child = Command::new("ls").arg("-l").spawn().unwrap(); let pid = Pid::from_raw(child.id() as i32); ``` while `id()` returns a `u32`. ``` fn id(&self) -> u32 ``` This itself...