Skip to content

Commit

Permalink
Comment cmsg_align.
Browse files Browse the repository at this point in the history
  • Loading branch information
kinetiknz committed Nov 15, 2017
1 parent a92ca5f commit b464f9b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sys/socket/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,10 @@ pub enum ControlMessage<'a> {
#[doc(hidden)]
pub struct UnknownCmsg<'a>(&'a cmsghdr, &'a [u8]);

// Round `len` up to meet the platform's required alignment for
// `cmsghdr`s and trailing `cmsghdr` data. This should match the
// behaviour of CMSG_ALIGN from the Linux headers and do the correct
// thing on other platforms that don't usually provide CMSG_ALIGN.
#[inline]
fn cmsg_align(len: usize) -> usize {
let align_bytes = mem::size_of::<align_of_cmsg_data>() - 1;
Expand Down

0 comments on commit b464f9b

Please sign in to comment.