about summary refs log tree commit diff
path: root/src/libnative
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-07-31 14:41:34 +0000
committerbors <bors@rust-lang.org>2014-07-31 14:41:34 +0000
commit9826e801bed408c2497a06c535a5691e1161c85f (patch)
tree64a0a1675c19f9bf0b3278a242f230d87d085aea /src/libnative
parent311a97062183efaa0a6344adb8746feb1523d5b1 (diff)
parent284ffc5b8206d8b32262014a0e7bbf1fa8d245a9 (diff)
downloadrust-9826e801bed408c2497a06c535a5691e1161c85f.tar.gz
rust-9826e801bed408c2497a06c535a5691e1161c85f.zip
auto merge of #16073 : mneumann/rust/dragonfly2, r=alexcrichton
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.rs8
-rw-r--r--src/libnative/io/mod.rs1
-rw-r--r--src/libnative/io/net.rs4
-rw-r--r--src/libnative/io/process.rs1
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 }