nix
nix copied to clipboard
Rust friendly bindings to *nix APIs
## What does this PR do Provide safe mechanisms to determine whether a signal's action is the default or ignore. This covers the majority of real-world calls to `sigaction()` with...
#101 made `sigaction` unsafe because of soundness issues for thread-local storage. It's unfortunate that the really common use case of setting signals to default or ignore now requires `unsafe`.
If NULL is passed as the second (new action) argument to `sigaction()`, then it won't make any changes, but will [return the existing action](https://man7.org/linux/man-pages/man2/sigaction.2.html). I don't believe nix provides any...
Hi, I try to implement a raw socket to be able to fetch all (sent/received) IP packets through a given network interface. For this I would like to use libc::IPPROTO_IP,...
When using connection-mode sockets like TCP, the addresses returned by `recvfrom`, `recvmsg` and `recvmmsg` are not initialized by the syscall. This is how the receive operations create an IPV4-Socketaddr, with...
```rust pub fn sendmmsg Safe because we know that pmhdr is valid, and we initialized it with // > sufficient space unsafe { cmsg.encode_into(pmhdr) }; pmhdr = unsafe { CMSG_NXTHDR(p,...
Realtime signals seem to be missing from `nix::sys::signal::Signal`, and quite a few functions seem to panic on receiving realtime signals: - `nix::sys::signal::SigSet::wait` - `nix::sys::wait::waitpid` (when the child died because of...
We have a use-case where we are intercepting the `madvise` syscall, and wish to handle certain types of advice specially. Without `TryFrom`, we need to write boilerplate to safely translate...
Calling an ioctl defined by ioctl_none! has a chance to access some memory it shouldn't when preparations have been made to push a buffer to stdout (specifically the length of...