aboutsummaryrefslogtreecommitdiff
path: root/ctr-std/src/sys/unix/stdio.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ctr-std/src/sys/unix/stdio.rs')
-rw-r--r--ctr-std/src/sys/unix/stdio.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/ctr-std/src/sys/unix/stdio.rs b/ctr-std/src/sys/unix/stdio.rs
index 6d38b00..e9b3d4a 100644
--- a/ctr-std/src/sys/unix/stdio.rs
+++ b/ctr-std/src/sys/unix/stdio.rs
@@ -25,13 +25,6 @@ impl Stdin {
fd.into_raw();
ret
}
-
- pub fn read_to_end(&self, buf: &mut Vec<u8>) -> io::Result<usize> {
- let fd = FileDesc::new(libc::STDIN_FILENO);
- let ret = fd.read_to_end(buf);
- fd.into_raw();
- ret
- }
}
impl Stdout {
@@ -77,5 +70,8 @@ impl io::Write for Stderr {
}
}
-pub const EBADF_ERR: i32 = ::libc::EBADF as i32;
+pub fn is_ebadf(err: &io::Error) -> bool {
+ err.raw_os_error() == Some(libc::EBADF as i32)
+}
+
pub const STDIN_BUF_SIZE: usize = ::sys_common::io::DEFAULT_BUF_SIZE;