From 46933f03117ae7d0c8c992e13d7f11a3ca3207da Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Sun, 14 Jan 2018 20:44:34 -0800 Subject: [PATCH] Add sockaddr_ctl on Mac --- libc-test/build.rs | 3 ++- src/unix/bsd/apple/mod.rs | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index 21e17a1cbef4b..1c1b0f5c2579d 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -177,6 +177,7 @@ fn main() { cfg.header("net/route.h"); cfg.header("netinet/if_ether.h"); cfg.header("sys/proc_info.h"); + cfg.header("sys/kern_control.h"); } if bsdlike { @@ -216,7 +217,7 @@ fn main() { cfg.header("sys/reg.h"); } } - + if linux || android || emscripten { cfg.header("malloc.h"); cfg.header("net/ethernet.h"); diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 7281f91968e2e..83911e6250f16 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -498,6 +498,15 @@ s! { pub sin_tos: ::c_ushort, pub sin_other: ::c_ushort, } + + pub struct sockaddr_ctl { + pub sc_len: ::c_uchar, + pub sc_family: ::c_uchar, + pub ss_sysaddr: ::uint16_t, + pub sc_id: ::uint32_t, + pub sc_unit: ::uint32_t, + pub sc_reserved: [::uint32_t; 5], + } } pub const _UTX_USERSIZE: usize = 256;