summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHomu <homu@barosl.com>2016-02-26 01:22:05 +0900
committerHomu <homu@barosl.com>2016-02-26 01:22:05 +0900
commit5aa0cc219d4500a13ea70876127dcdd019cbcc31 (patch)
treedbf69b5bd4bde5bb522abe6d9e33f82497d7bf85 /src
parent2bffa28cd9eb440b32cffaa8102dd249255cf0dd (diff)
parent87211f72d40b5bba4d59b573d0a05907ae74e702 (diff)
downloadnix-5aa0cc219d4500a13ea70876127dcdd019cbcc31.zip
Auto merge of #279 - polezaivsani:openbsd_make, r=fiveop
Openbsd make and a few BSD-related fixes
Diffstat (limited to 'src')
-rw-r--r--src/sys/mman.rs4
-rw-r--r--src/sys/socket/consts.rs4
-rw-r--r--src/sys/socket/sockopt.rs8
3 files changed, 8 insertions, 8 deletions
diff --git a/src/sys/mman.rs b/src/sys/mman.rs
index 1825a9a1..a23526d6 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 {
@@ -131,9 +131,11 @@ 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,
+ #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
const MAP_NOSYNC = libc::MAP_NOSYNC,
const MAP_ANON = libc::MAP_ANON,
}
diff --git a/src/sys/socket/consts.rs b/src/sys/socket/consts.rs
index 8d88959b..ddd8f6a9 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;
@@ -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);