[][src]Function uapi::cmsg_write

pub fn cmsg_write<T: ?Sized>(
    buf: &mut &mut [MaybeUninit<u8>],
    hdr: cmsghdr,
    data: &T
) -> Result<usize>

Writes a cmsg to a buffer

This function will

  • set hdr.cmsg_len to the correct value
  • write hdr and data to the buffer
  • advance the buffer by the used space
  • return the used space

Returns an error if there is not enough space in the buffer.

See also the crate documentation.