diff options
| author | Michael Neumann <mneumann@ntecs.de> | 2014-07-29 16:44:39 +0200 |
|---|---|---|
| committer | Michael Neumann <mneumann@ntecs.de> | 2014-07-29 16:44:39 +0200 |
| commit | 2e2f53fad210543be39f6997991abcd403533676 (patch) | |
| tree | 2f20ba5f45c3e60332b2cc5509659002862b6160 /src/libnative | |
| parent | 72e2c7dec34bd87fab6bb15bb7d3d97269d4afd3 (diff) | |
| download | rust-2e2f53fad210543be39f6997991abcd403533676.tar.gz rust-2e2f53fad210543be39f6997991abcd403533676.zip | |
Port Rust to DragonFlyBSD
Not included are two required patches: * LLVM: segmented stack support for DragonFly [1] * jemalloc: simple configure patches [1]: http://reviews.llvm.org/D4705
Diffstat (limited to 'src/libnative')
| -rw-r--r-- | src/libnative/io/c_unix.rs | 8 | ||||
| -rw-r--r-- | src/libnative/io/mod.rs | 1 | ||||
| -rw-r--r-- | src/libnative/io/net.rs | 4 | ||||
| -rw-r--r-- | src/libnative/io/process.rs | 1 |
4 files changed, 13 insertions, 1 deletions
diff --git a/src/libnative/io/c_unix.rs b/src/libnative/io/c_unix.rs index 9fbf3659d3f..af4d309dfe2 100644 --- a/src/libnative/io/c_unix.rs +++ b/src/libnative/io/c_unix.rs @@ -22,6 +22,7 @@ use libc; #[cfg(target_os = "macos")] #[cfg(target_os = "ios")] #[cfg(target_os = "freebsd")] +#[cfg(target_os = "dragonfly")] pub static FIONBIO: libc::c_ulong = 0x8004667e; #[cfg(target_os = "linux", target_arch = "x86")] #[cfg(target_os = "linux", target_arch = "x86_64")] @@ -35,6 +36,7 @@ pub static FIONBIO: libc::c_ulong = 0x667e; #[cfg(target_os = "macos")] #[cfg(target_os = "ios")] #[cfg(target_os = "freebsd")] +#[cfg(target_os = "dragonfly")] pub static FIOCLEX: libc::c_ulong = 0x20006601; #[cfg(target_os = "linux", target_arch = "x86")] #[cfg(target_os = "linux", target_arch = "x86_64")] @@ -48,6 +50,7 @@ pub static FIOCLEX: libc::c_ulong = 0x6601; #[cfg(target_os = "macos")] #[cfg(target_os = "ios")] #[cfg(target_os = "freebsd")] +#[cfg(target_os = "dragonfly")] pub static MSG_DONTWAIT: libc::c_int = 0x80; #[cfg(target_os = "linux")] #[cfg(target_os = "android")] @@ -99,6 +102,7 @@ mod select { #[cfg(target_os = "android")] #[cfg(target_os = "freebsd")] +#[cfg(target_os = "dragonfly")] #[cfg(target_os = "linux")] mod select { use std::uint; @@ -106,6 +110,7 @@ mod select { pub static FD_SETSIZE: uint = 1024; pub struct fd_set { + // FIXME: shouldn't this be a c_ulong? fds_bits: [uint, ..(FD_SETSIZE / uint::BITS)] } @@ -202,6 +207,7 @@ mod signal { #[cfg(target_os = "macos")] #[cfg(target_os = "ios")] #[cfg(target_os = "freebsd")] +#[cfg(target_os = "dragonfly")] mod signal { use libc; @@ -218,6 +224,7 @@ mod signal { #[cfg(target_os = "ios")] pub type sigset_t = u32; #[cfg(target_os = "freebsd")] + #[cfg(target_os = "dragonfly")] pub struct sigset_t { bits: [u32, ..4], } @@ -243,6 +250,7 @@ mod signal { } #[cfg(target_os = "freebsd")] + #[cfg(target_os = "dragonfly")] pub struct sigaction { pub sa_handler: extern fn(libc::c_int), pub sa_flags: libc::c_int, diff --git a/src/libnative/io/mod.rs b/src/libnative/io/mod.rs index ecdf4ad2c45..db5421481ee 100644 --- a/src/libnative/io/mod.rs +++ b/src/libnative/io/mod.rs @@ -52,6 +52,7 @@ pub mod file; #[cfg(target_os = "macos")] #[cfg(target_os = "ios")] #[cfg(target_os = "freebsd")] +#[cfg(target_os = "dragonfly")] #[cfg(target_os = "android")] #[cfg(target_os = "linux")] #[path = "timer_unix.rs"] diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs index c3eb5e91e90..7a90ede8ca8 100644 --- a/src/libnative/io/net.rs +++ b/src/libnative/io/net.rs @@ -326,11 +326,13 @@ impl TcpStream { seconds as libc::c_int) } #[cfg(target_os = "freebsd")] + #[cfg(target_os = "dragonfly")] fn set_tcp_keepalive(&mut self, seconds: uint) -> IoResult<()> { setsockopt(self.fd(), libc::IPPROTO_TCP, libc::TCP_KEEPIDLE, seconds as libc::c_int) } - #[cfg(not(target_os = "macos"), not(target_os = "ios"), not(target_os = "freebsd"))] + #[cfg(not(target_os = "macos"), not(target_os = "ios"), not(target_os = "freebsd"), + not(target_os = "dragonfly"))] fn set_tcp_keepalive(&mut self, _seconds: uint) -> IoResult<()> { Ok(()) } diff --git a/src/libnative/io/process.rs b/src/libnative/io/process.rs index e3e6ae42526..c89a40d6513 100644 --- a/src/libnative/io/process.rs +++ b/src/libnative/io/process.rs @@ -847,6 +847,7 @@ fn translate_status(status: c_int) -> rtio::ProcessExit { #[cfg(target_os = "macos")] #[cfg(target_os = "ios")] #[cfg(target_os = "freebsd")] + #[cfg(target_os = "dragonfly")] mod imp { pub fn WIFEXITED(status: i32) -> bool { (status & 0x7f) == 0 } pub fn WEXITSTATUS(status: i32) -> i32 { status >> 8 } |
