We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a92ca5f commit b464f9bCopy full SHA for b464f9b
src/sys/socket/mod.rs
@@ -392,6 +392,10 @@ pub enum ControlMessage<'a> {
392
#[doc(hidden)]
393
pub struct UnknownCmsg<'a>(&'a cmsghdr, &'a [u8]);
394
395
+// Round `len` up to meet the platform's required alignment for
396
+// `cmsghdr`s and trailing `cmsghdr` data. This should match the
397
+// behaviour of CMSG_ALIGN from the Linux headers and do the correct
398
+// thing on other platforms that don't usually provide CMSG_ALIGN.
399
#[inline]
400
fn cmsg_align(len: usize) -> usize {
401
let align_bytes = mem::size_of::<align_of_cmsg_data>() - 1;
0 commit comments