Skip to content

Commit cbafac5

Browse files
committed
Fix compilation on Redox
1 parent 29dece1 commit cbafac5

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/libstd/sys/redox/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use io::{self, ErrorKind};
1414

1515
pub mod args;
16-
#[cfg(any(not(cargobuild), feature = "backtrace"))]
16+
#[cfg(feature = "backtrace")]
1717
pub mod backtrace;
1818
pub mod condvar;
1919
pub mod env;

src/libstd/sys/redox/net/tcp.rs

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ impl TcpStream {
6363
Ok(path_to_local_addr(path.to_str().unwrap_or("")))
6464
}
6565

66+
pub fn peek(&self, _buf: &mut [u8]) -> Result<usize> {
67+
Err(Error::new(ErrorKind::Other, "TcpStream::peek not implemented"))
68+
}
69+
6670
pub fn shutdown(&self, _how: Shutdown) -> Result<()> {
6771
Err(Error::new(ErrorKind::Other, "TcpStream::shutdown not implemented"))
6872
}

src/libstd/sys/redox/net/udp.rs

+8
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ impl UdpSocket {
8787
Ok(path_to_local_addr(path.to_str().unwrap_or("")))
8888
}
8989

90+
pub fn peek(&self, _buf: &mut [u8]) -> Result<usize> {
91+
Err(Error::new(ErrorKind::Other, "UdpSocket::peek not implemented"))
92+
}
93+
94+
pub fn peek_from(&self, _buf: &mut [u8]) -> Result<(usize, SocketAddr)> {
95+
Err(Error::new(ErrorKind::Other, "UdpSocket::peek_from not implemented"))
96+
}
97+
9098
pub fn broadcast(&self) -> Result<bool> {
9199
Err(Error::new(ErrorKind::Other, "UdpSocket::broadcast not implemented"))
92100
}

0 commit comments

Comments
 (0)