Sync computers
This commit is contained in:
22
crates/std/src/io.rs
Normal file
22
crates/std/src/io.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use crate::fs::File;
|
||||
use io::IoBase;
|
||||
pub use io::Read;
|
||||
pub use io::Seek;
|
||||
pub use io::SeekFrom;
|
||||
pub use io::Write;
|
||||
|
||||
pub struct Stdin;
|
||||
|
||||
impl IoBase for Stdin {
|
||||
type Error = ();
|
||||
}
|
||||
|
||||
impl Read for Stdin {
|
||||
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> {
|
||||
unsafe { File::from_raw_fd(0).read(buf) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn stdin() -> Stdin {
|
||||
Stdin
|
||||
}
|
||||
Reference in New Issue
Block a user