Rollup merge of - 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
This commit is contained in:
Eduard-Mihai Burtescu 2017-02-25 14:13:24 +02:00 committed by GitHub
commit ef043a7c43
3 changed files with 13 additions and 1 deletions
src/libstd/sys/redox

@ -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;

@ -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"))
}

@ -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"))
}