Skip to content

Commit

Permalink
Hermit: Add File::set_time stub
Browse files Browse the repository at this point in the history
This is not supported on hermit yet. This change is required for compiling std.
  • Loading branch information
mkroening committed Sep 4, 2022
1 parent b11bf65 commit 3b985b4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions library/std/src/sys/hermit/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ pub struct OpenOptions {
mode: i32,
}

#[derive(Copy, Clone, Debug, Default)]
pub struct FileTimes {}

pub struct FilePermissions(!);

pub struct FileType(!);
Expand Down Expand Up @@ -110,6 +113,11 @@ impl fmt::Debug for FilePermissions {
}
}

impl FileTimes {
pub fn set_accessed(&mut self, _t: SystemTime) {}
pub fn set_modified(&mut self, _t: SystemTime) {}
}

impl FileType {
pub fn is_dir(&self) -> bool {
self.0
Expand Down Expand Up @@ -344,6 +352,10 @@ impl File {
pub fn set_permissions(&self, _perm: FilePermissions) -> io::Result<()> {
Err(Error::from_raw_os_error(22))
}

pub fn set_times(&self, _times: FileTimes) -> io::Result<()> {
Err(Error::from_raw_os_error(22))
}
}

impl DirBuilder {
Expand Down

0 comments on commit 3b985b4

Please sign in to comment.