From 73d48b35269bf297d66b2333040b296f26b403a1 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Tue, 29 Jan 2019 17:57:50 -0800 Subject: Update libc crate to 0.2.48 This change updates the libc crate to version 0.2.48. Import subrepo libc/:libc at 42cd3ba27254c423e03f6f4324de57075047f6a0 --- libc/src/unix/bsd/mod.rs | 41 +++++++---------------------------------- 1 file changed, 7 insertions(+), 34 deletions(-) (limited to 'libc/src/unix/bsd/mod.rs') diff --git a/libc/src/unix/bsd/mod.rs b/libc/src/unix/bsd/mod.rs index 03125c9..12f6e14 100644 --- a/libc/src/unix/bsd/mod.rs +++ b/libc/src/unix/bsd/mod.rs @@ -57,7 +57,9 @@ s! { pub ifa_addr: *mut ::sockaddr, pub ifa_netmask: *mut ::sockaddr, pub ifa_dstaddr: *mut ::sockaddr, - pub ifa_data: *mut ::c_void + pub ifa_data: *mut ::c_void, + #[cfg(target_os = "netbsd")] + pub ifa_addrflags: ::c_uint } pub struct fd_set { @@ -340,43 +342,14 @@ pub const POLLRDBAND: ::c_short = 0x080; pub const POLLWRBAND: ::c_short = 0x100; f! { - pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { - if (*mhdr).msg_controllen as usize >= mem::size_of::() { - (*mhdr).msg_control as *mut cmsghdr + pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr { + if (*mhdr).msg_controllen as usize >= mem::size_of::<::cmsghdr>() { + (*mhdr).msg_control as *mut ::cmsghdr } else { - 0 as *mut cmsghdr + 0 as *mut ::cmsghdr } } - pub fn CMSG_NXTHDR(mhdr: *const msghdr, - cmsg: *const cmsghdr) -> *mut cmsghdr { - if cmsg.is_null() { - return CMSG_FIRSTHDR(mhdr); - }; - let pad = mem::align_of::() - 1; - let next = cmsg as usize + (*cmsg).cmsg_len as usize + pad & !pad; - let max = (*mhdr).msg_control as usize - + (*mhdr).msg_controllen as usize; - if next < max { - next as *mut cmsghdr - } else { - 0 as *mut cmsghdr - } - } - - pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut ::c_uchar { - cmsg.offset(1) as *mut ::c_uchar - } - - pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { - let pad = mem::align_of::() as ::c_uint - 1; - mem::size_of::() as ::c_uint + ((length + pad) & !pad) - } - - pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { - mem::size_of::() as ::c_uint + length - } - pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8; let fd = fd as usize; -- cgit v1.2.1