preopens with Caps::all, implement create, remove dir, remove file

This commit is contained in:
Pat Hickey
2020-12-16 15:15:48 -08:00
parent c0461ca170
commit 27ddbda829
5 changed files with 80 additions and 20 deletions

View File

@@ -170,6 +170,21 @@ impl FileCaps {
pub const FILESTAT_GET: Self = FileCaps { flags: 512 };
pub const FILESTAT_SET_SIZE: Self = FileCaps { flags: 1024 };
pub const FILESTAT_SET_TIMES: Self = FileCaps { flags: 2048 };
pub fn all() -> FileCaps {
Self::DATASYNC
| Self::READ
| Self::SEEK
| Self::FDSTAT_SET_FLAGS
| Self::SYNC
| Self::TELL
| Self::WRITE
| Self::ADVISE
| Self::ALLOCATE
| Self::FILESTAT_GET
| Self::FILESTAT_SET_SIZE
| Self::FILESTAT_SET_TIMES
}
}
impl std::ops::BitOr for FileCaps {
@@ -181,12 +196,6 @@ impl std::ops::BitOr for FileCaps {
}
}
impl std::fmt::Display for FileCaps {
fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
todo!()
}
}
pub struct FdStat {
pub filetype: Filetype,
pub caps: FileCaps,