Skip to content

Commit

Permalink
Fix compilation on Redox
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Feb 9, 2017
1 parent 29dece1 commit cbafac5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/sys/redox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/libstd/sys/redox/net/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
Expand Down
8 changes: 8 additions & 0 deletions src/libstd/sys/redox/net/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
Expand Down

0 comments on commit cbafac5

Please sign in to comment.