Function with_recv_msghdr

Source
pub(crate) unsafe fn with_recv_msghdr<R>(
    name: &mut SocketAddrBuf,
    iov: &mut [IoSliceMut<'_>],
    control: &mut RecvAncillaryBuffer<'_>,
    f: impl FnOnce(&mut msghdr) -> Result<R>,
) -> Result<R>
Expand description

Create a message header intended to receive a datagram.

ยงSafety

If f dereferences the pointers in the msghdr, it must do so only within the bounds indicated by the associated lengths in the msghdr.

And, if f returns Ok, it must have updated the msg_controllen field of the msghdr to indicate how many bytes it initialized.