rCore-Tutorial-v3/os/src/fs/mod.rs

16 lines
375 B
Rust
Raw Normal View History

2020-12-13 11:07:19 +04:00
mod pipe;
mod stdio;
mod inode;
2020-12-13 11:07:19 +04:00
use crate::mm::UserBuffer;
2021-02-18 20:38:21 +04:00
pub trait File : Send + Sync {
fn readable(&self) -> bool;
fn writable(&self) -> bool;
2020-12-13 11:07:19 +04:00
fn read(&self, buf: UserBuffer) -> usize;
fn write(&self, buf: UserBuffer) -> usize;
}
2020-12-14 12:18:33 +04:00
pub use pipe::{Pipe, make_pipe};
pub use stdio::{Stdin, Stdout};
pub use inode::{OSInode, open_file, OpenFlags, list_apps};