1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
mod inode;
mod stdio;
use crate::mm::UserBuffer;
pub trait File: Send + Sync {
fn readable(&self) -> bool;
fn writable(&self) -> bool;
fn read(&self, buf: UserBuffer) -> usize;
fn write(&self, buf: UserBuffer) -> usize;
}
#[repr(C)]
#[derive(Debug)]
pub struct Stat {
pub dev: u64,
pub ino: u64,
pub mode: StatMode,
pub nlink: u32,
pad: [u64; 7],
}
bitflags! {
pub struct StatMode: u32 {
const NULL = 0;
const DIR = 0o040000;
const FILE = 0o100000;
}
}
pub use inode::{list_apps, open_file, OSInode, OpenFlags};
pub use stdio::{Stdin, Stdout};