Skip to content

Commit a56d66f

Browse files
committed
add docs for pack_mhdr_to_receive
1 parent 7424de0 commit a56d66f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/sys/socket/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,6 +1844,17 @@ unsafe fn read_mhdr<'a, S>(
18441844
}
18451845
}
18461846

1847+
/// Pack pointers to various structures into into msghdr
1848+
///
1849+
/// # Safety
1850+
/// `iov_buffer` and `iov_buffer_len` must point to a slice
1851+
/// of `IoSliceMut` and number of available elements or be a null pointer and 0
1852+
///
1853+
/// `cmsg_buffer` and `cmsg_capacity` must point to a byte buffer used
1854+
/// to store control headers later or be a null pointer and 0 if control
1855+
/// headers are not used
1856+
///
1857+
/// Buffers must remain valid for the whole lifetime of msghdr
18471858
unsafe fn pack_mhdr_to_receive<S>(
18481859
iov_buffer: *const IoSliceMut,
18491860
iov_buffer_len: usize,

0 commit comments

Comments
 (0)