nix-rust / nix

Rust friendly bindings to *nix APIs
MIT License
2.67k stars 667 forks source link

Add preallocated buffer version of sendmsg #2498

Open howjmay opened 2 months ago

howjmay commented 2 months ago

closes #2457

SteveLauC commented 2 months ago

For the CI failure, you can allow the lint if necessary:

error: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
    --> src/sys/socket/mod.rs:1650:64
     |
1650 |                flags: MsgFlags, addr: Option<&S>, cmsg_buffer: &mut Vec<u8>) -> Result<usize>
     |                                                                ^^^^^^^^^^^^ help: change this to: `&mut [u8]`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
     = note: `-D clippy::ptr-arg` implied by `-D warnings`