diff options
author | Daniel Mueller <deso@posteo.net> | 2019-01-29 17:57:50 -0800 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2019-01-29 17:57:50 -0800 |
commit | 73d48b35269bf297d66b2333040b296f26b403a1 (patch) | |
tree | 952fda784782d55183fb57d80a32a61255f1c572 /libc/src/unix/bsd/mod.rs | |
parent | 750c5dfef0e4d06a342d7f6fd5fb1b98e87043e0 (diff) | |
download | nitrocli-73d48b35269bf297d66b2333040b296f26b403a1.tar.gz nitrocli-73d48b35269bf297d66b2333040b296f26b403a1.tar.bz2 |
Update libc crate to 0.2.48
This change updates the libc crate to version 0.2.48.
Import subrepo libc/:libc at 42cd3ba27254c423e03f6f4324de57075047f6a0
Diffstat (limited to 'libc/src/unix/bsd/mod.rs')
-rw-r--r-- | libc/src/unix/bsd/mod.rs | 41 |
1 files changed, 7 insertions, 34 deletions
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::<cmsghdr>() { - (*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::<cmsghdr>() - 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::<cmsghdr>() as ::c_uint - 1; - mem::size_of::<cmsghdr>() as ::c_uint + ((length + pad) & !pad) - } - - pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { - mem::size_of::<cmsghdr>() 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; |