From b84d2f27bc6c54ceeda3209517917d126bf2c0cd Mon Sep 17 00:00:00 2001 From: Vasily Kolobkov <> Date: Thu, 25 Feb 2016 14:05:12 +0200 Subject: Use libc with OpenBSD kin --- src/sys/socket/consts.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/sys/socket/consts.rs b/src/sys/socket/consts.rs index 8d88959b..b6212b67 100644 --- a/src/sys/socket/consts.rs +++ b/src/sys/socket/consts.rs @@ -116,7 +116,7 @@ mod os { target_os = "freebsd"))] use libc::{self, c_int, uint8_t}; #[cfg(any(target_os = "openbsd", target_os = "netbsd"))] - use libc::{c_int, uint8_t}; + use libc::{self, c_int, uint8_t}; pub const AF_UNIX: c_int = 1; pub const AF_LOCAL: c_int = AF_UNIX; -- cgit v1.2.3 From 838d3e20f42c86bb26923a1432e10dede0f627ad Mon Sep 17 00:00:00 2001 From: Vasily Kolobkov <> Date: Thu, 25 Feb 2016 14:28:34 +0200 Subject: Fix IPV6 group membership options on OpenBSD --- src/sys/socket/consts.rs | 2 -- src/sys/socket/sockopt.rs | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/sys/socket/consts.rs b/src/sys/socket/consts.rs index b6212b67..ddd8f6a9 100644 --- a/src/sys/socket/consts.rs +++ b/src/sys/socket/consts.rs @@ -210,9 +210,7 @@ mod os { pub const IP_ADD_MEMBERSHIP: c_int = 12; pub const IP_DROP_MEMBERSHIP: c_int = 13; - #[cfg(not(target_os = "openbsd"))] pub const IPV6_JOIN_GROUP: c_int = libc::IPV6_JOIN_GROUP; - #[cfg(not(target_os = "openbsd"))] pub const IPV6_LEAVE_GROUP: c_int = libc::IPV6_LEAVE_GROUP; pub type InAddrT = u32; diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs index 4e067d44..17de2d27 100644 --- a/src/sys/socket/sockopt.rs +++ b/src/sys/socket/sockopt.rs @@ -130,13 +130,13 @@ sockopt_impl!(Both, TcpNoDelay, consts::IPPROTO_TCP, consts::TCP_NODELAY, bool); sockopt_impl!(Both, Linger, consts::SOL_SOCKET, consts::SO_LINGER, super::linger); sockopt_impl!(SetOnly, IpAddMembership, consts::IPPROTO_IP, consts::IP_ADD_MEMBERSHIP, super::ip_mreq); sockopt_impl!(SetOnly, IpDropMembership, consts::IPPROTO_IP, consts::IP_DROP_MEMBERSHIP, super::ip_mreq); -#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "netbsd", target_os = "dragonfly", target_os = "freebsd")))] +#[cfg(not(any(target_os = "dragonfly", target_os = "freebsd", target_os = "ios", target_os = "macos", target_os = "netbsd", target_os = "openbsd")))] sockopt_impl!(SetOnly, Ipv6AddMembership, consts::IPPROTO_IPV6, consts::IPV6_ADD_MEMBERSHIP, super::ipv6_mreq); -#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "netbsd", target_os = "dragonfly", target_os = "freebsd")))] +#[cfg(not(any(target_os = "dragonfly", target_os = "freebsd", target_os = "ios", target_os = "macos", target_os = "netbsd", target_os = "openbsd")))] sockopt_impl!(SetOnly, Ipv6DropMembership, consts::IPPROTO_IPV6, consts::IPV6_DROP_MEMBERSHIP, super::ipv6_mreq); -#[cfg(any(target_os = "macos", target_os = "ios", target_os = "netbsd", target_os = "dragonfly", target_os = "freebsd"))] +#[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "ios", target_os = "macos", target_os = "netbsd", target_os = "openbsd"))] sockopt_impl!(SetOnly, Ipv6AddMembership, consts::IPPROTO_IPV6, consts::IPV6_JOIN_GROUP, super::ipv6_mreq); -#[cfg(any(target_os = "macos", target_os = "ios", target_os = "netbsd", target_os = "dragonfly", target_os = "freebsd"))] +#[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "ios", target_os = "macos", target_os = "netbsd", target_os = "openbsd"))] sockopt_impl!(SetOnly, Ipv6DropMembership, consts::IPPROTO_IPV6, consts::IPV6_LEAVE_GROUP, super::ipv6_mreq); sockopt_impl!(Both, IpMulticastTtl, consts::IPPROTO_IP, consts::IP_MULTICAST_TTL, u8); sockopt_impl!(Both, IpMulticastLoop, consts::IPPROTO_IP, consts::IP_MULTICAST_LOOP, bool); -- cgit v1.2.3 From 942a00e404e87387a00aee39f19f213d147cbb09 Mon Sep 17 00:00:00 2001 From: Vasily Kolobkov <> Date: Thu, 25 Feb 2016 14:31:10 +0200 Subject: Use libc --- src/sys/mman.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/sys/mman.rs b/src/sys/mman.rs index 1825a9a1..d7d43533 100644 --- a/src/sys/mman.rs +++ b/src/sys/mman.rs @@ -120,7 +120,7 @@ mod consts { #[cfg(any(target_os = "freebsd", target_os = "dragonfly", target_os = "openbsd", target_os = "netbsd"))] mod consts { - use libc::c_int; + use libc::{self, c_int}; bitflags!{ flags MapFlags: c_int { -- cgit v1.2.3 From ddef34002c45d99f4fd5b8b028ebbfa3c08a1c11 Mon Sep 17 00:00:00 2001 From: Vasily Kolobkov <> Date: Thu, 25 Feb 2016 14:41:10 +0200 Subject: Withdraw MAP_STACK flag from OpenBSD --- src/sys/mman.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/sys/mman.rs b/src/sys/mman.rs index d7d43533..0b80b410 100644 --- a/src/sys/mman.rs +++ b/src/sys/mman.rs @@ -131,6 +131,7 @@ mod consts { const MAP_RENAME = libc::MAP_RENAME, const MAP_NORESERVE = libc::MAP_NORESERVE, const MAP_HASSEMAPHORE = libc::MAP_HASSEMAPHORE, + #[cfg(not(target_os = "openbsd"))] const MAP_STACK = libc::MAP_STACK, #[cfg(target_os = "netbsd")] const MAP_WIRED = libc::MAP_WIRED, -- cgit v1.2.3 From 87211f72d40b5bba4d59b573d0a05907ae74e702 Mon Sep 17 00:00:00 2001 From: Vasily Kolobkov <> Date: Thu, 25 Feb 2016 14:52:59 +0200 Subject: Limit MAP_NOSYNC flag to FreeBSD kin --- src/sys/mman.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/sys/mman.rs b/src/sys/mman.rs index 0b80b410..a23526d6 100644 --- a/src/sys/mman.rs +++ b/src/sys/mman.rs @@ -135,6 +135,7 @@ mod consts { const MAP_STACK = libc::MAP_STACK, #[cfg(target_os = "netbsd")] const MAP_WIRED = libc::MAP_WIRED, + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] const MAP_NOSYNC = libc::MAP_NOSYNC, const MAP_ANON = libc::MAP_ANON, } -- cgit v1.2.3