]> git.lizzy.rs Git - rust.git/commitdiff
Fix compilation on Redox
authorJeremy Soller <jackpot51@gmail.com>
Thu, 9 Feb 2017 03:01:57 +0000 (20:01 -0700)
committerJeremy Soller <jackpot51@gmail.com>
Thu, 9 Feb 2017 03:01:57 +0000 (20:01 -0700)
src/libstd/sys/redox/mod.rs
src/libstd/sys/redox/net/tcp.rs
src/libstd/sys/redox/net/udp.rs

index 5982bdd6549ca46a131810c60a4305851bc9a493..31c40ea58b1de103a979647e24b66034798c1858 100644 (file)
@@ -13,7 +13,7 @@
 use io::{self, ErrorKind};
 
 pub mod args;
-#[cfg(any(not(cargobuild), feature = "backtrace"))]
+#[cfg(feature = "backtrace")]
 pub mod backtrace;
 pub mod condvar;
 pub mod env;
index a3f202ccd97cbc492c2692c0692bb8e8448f7197..936097d7fb2a602264f32294bd343170bf67326a 100644 (file)
@@ -63,6 +63,10 @@ pub fn socket_addr(&self) -> Result<SocketAddr> {
         Ok(path_to_local_addr(path.to_str().unwrap_or("")))
     }
 
+    pub fn peek(&self, _buf: &mut [u8]) -> Result<usize> {
+        Err(Error::new(ErrorKind::Other, "TcpStream::peek not implemented"))
+    }
+
     pub fn shutdown(&self, _how: Shutdown) -> Result<()> {
         Err(Error::new(ErrorKind::Other, "TcpStream::shutdown not implemented"))
     }
index 36f0819d308849cb8c087919fe0f4b8ee4fa46d4..93ebcc95fd0f87e0c70fa6584678ec2cab778a8a 100644 (file)
@@ -87,6 +87,14 @@ pub fn socket_addr(&self) -> Result<SocketAddr> {
         Ok(path_to_local_addr(path.to_str().unwrap_or("")))
     }
 
+    pub fn peek(&self, _buf: &mut [u8]) -> Result<usize> {
+        Err(Error::new(ErrorKind::Other, "UdpSocket::peek not implemented"))
+    }
+
+    pub fn peek_from(&self, _buf: &mut [u8]) -> Result<(usize, SocketAddr)> {
+        Err(Error::new(ErrorKind::Other, "UdpSocket::peek_from not implemented"))
+    }
+
     pub fn broadcast(&self) -> Result<bool> {
         Err(Error::new(ErrorKind::Other, "UdpSocket::broadcast not implemented"))
     }