From 49b4213a18b71906d876469c0e1eaf295ad904bc Mon Sep 17 00:00:00 2001 From: luozijun Date: Wed, 6 Dec 2017 17:29:04 +0800 Subject: [PATCH] FIX --- src/unix/bsd/freebsdlike/mod.rs | 16 ++++++++++++++++ src/unix/bsd/mod.rs | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index 5703e073..54f3345e 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -159,6 +159,22 @@ s! { pub int_p_sign_posn: ::c_char, pub int_n_sign_posn: ::c_char, } + + // See /usr/include/net/if_dl.h + // sdl_data does not match if_dl.h on OS X, + // since the size of 12 is a minimum. + // Will be unsafe + // when sdl_nlen > 40. + pub struct sockaddr_dl { + pub sdl_len: ::c_uchar, + pub sdl_family: ::c_uchar, + pub sdl_index: ::c_ushort, + pub sdl_type: ::c_uchar, + pub sdl_nlen: ::c_uchar, + pub sdl_alen: ::c_uchar, + pub sdl_slen: ::c_uchar, + pub sdl_data: [::c_char; 46] + } } pub const AIO_LISTIO_MAX: ::c_int = 16; diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 4e996041..57db9895 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -61,22 +61,6 @@ s! { pub ifa_data: *mut ::c_void } - // See /usr/include/net/if_dl.h - // sdl_data does not match if_dl.h on OS X, since the size of 12 is a minimum. - // Will be unsafe - // when sdl_nlen > 40. - #[cfg(any(target_os = "freebsd", target_os = "macos"))] - pub struct sockaddr_dl { - pub sdl_len: ::c_uchar, - pub sdl_family: ::c_uchar, - pub sdl_index: ::c_ushort, - pub sdl_type: ::c_uchar, - pub sdl_nlen: ::c_uchar, - pub sdl_alen: ::c_uchar, - pub sdl_slen: ::c_uchar, - pub sdl_data: [::c_char; 46], - } - pub struct fd_set { #[cfg(all(target_pointer_width = "64", any(target_os = "freebsd", target_os = "dragonfly")))]