about summary refs log tree commit diff
path: root/src/libstd/sys/common/net.rs
diff options
context:
space:
mode:
authorSébastien Marie <semarie@users.noreply.github.com>2015-01-29 08:19:28 +0100
committerSébastien Marie <semarie@users.noreply.github.com>2015-02-01 14:41:38 +0100
commitfcb30a0b67b1bd4acbc3422ff74fac5d031ae1ae (patch)
tree055fbf1fe9f0b9bd89481f29105fef90370d7789 /src/libstd/sys/common/net.rs
parentf1f9cb705df95171fce4e575374c959509e58dea (diff)
downloadrust-fcb30a0b67b1bd4acbc3422ff74fac5d031ae1ae.tar.gz
rust-fcb30a0b67b1bd4acbc3422ff74fac5d031ae1ae.zip
openbsd support
Diffstat (limited to 'src/libstd/sys/common/net.rs')
-rw-r--r--src/libstd/sys/common/net.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs
index 51b6e0a1c1e..c826522e5d1 100644
--- a/src/libstd/sys/common/net.rs
+++ b/src/libstd/sys/common/net.rs
@@ -1,4 +1,4 @@
-// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
+// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
 //
@@ -694,10 +694,16 @@ impl TcpStream {
         setsockopt(self.fd(), libc::IPPROTO_TCP, libc::TCP_KEEPIDLE,
                    seconds as libc::c_int)
     }
+    #[cfg(target_os = "openbsd")]
+    fn set_tcp_keepalive(&mut self, seconds: uint) -> IoResult<()> {
+        setsockopt(self.fd(), libc::IPPROTO_TCP, libc::SO_KEEPALIVE,
+                   seconds as libc::c_int)
+    }
     #[cfg(not(any(target_os = "macos",
                   target_os = "ios",
                   target_os = "freebsd",
-                  target_os = "dragonfly")))]
+                  target_os = "dragonfly",
+                  target_os = "openbsd")))]
     fn set_tcp_keepalive(&mut self, _seconds: uint) -> IoResult<()> {
         Ok(())
     }