diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2017-02-25 14:13:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-25 14:13:24 +0200 |
| commit | ef043a7c43070e125361e6609c85ea8a67631e0d (patch) | |
| tree | 5bf8dbd9e4861038705fad47f3f76bb2930af9e5 /src/libstd/sys | |
| parent | a6a5c32e0ebcd444f5ab274edb5531d3749936a3 (diff) | |
| parent | cbafac5ba188f118d895bb075060081be3aa2800 (diff) | |
| download | rust-ef043a7c43070e125361e6609c85ea8a67631e0d.tar.gz rust-ef043a7c43070e125361e6609c85ea8a67631e0d.zip | |
Rollup merge of #39961 - redox-os:redox, r=alexcrichton
Fix compilation on Redox This updates the Redox sys module to fix compilation. The functions peek and peek_from are added to TcpStream and UdpSocket as stubs. The sys::backtrace module is now included correctly
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/redox/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/redox/net/tcp.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/redox/net/udp.rs | 8 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/libstd/sys/redox/mod.rs b/src/libstd/sys/redox/mod.rs index 5982bdd6549..31c40ea58b1 100644 --- a/src/libstd/sys/redox/mod.rs +++ b/src/libstd/sys/redox/mod.rs @@ -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; diff --git a/src/libstd/sys/redox/net/tcp.rs b/src/libstd/sys/redox/net/tcp.rs index a3f202ccd97..936097d7fb2 100644 --- a/src/libstd/sys/redox/net/tcp.rs +++ b/src/libstd/sys/redox/net/tcp.rs @@ -63,6 +63,10 @@ impl TcpStream { 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")) } diff --git a/src/libstd/sys/redox/net/udp.rs b/src/libstd/sys/redox/net/udp.rs index 36f0819d308..93ebcc95fd0 100644 --- a/src/libstd/sys/redox/net/udp.rs +++ b/src/libstd/sys/redox/net/udp.rs @@ -87,6 +87,14 @@ impl UdpSocket { 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")) } |
