Skip to content

Commit 3b985b4

Browse files
committed
Hermit: Add File::set_time stub
This is not supported on hermit yet. This change is required for compiling std.
1 parent b11bf65 commit 3b985b4

File tree

1 file changed

+12
-0
lines changed
  • library/std/src/sys/hermit

1 file changed

+12
-0
lines changed

library/std/src/sys/hermit/fs.rs

+12
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ pub struct OpenOptions {
4141
mode: i32,
4242
}
4343

44+
#[derive(Copy, Clone, Debug, Default)]
45+
pub struct FileTimes {}
46+
4447
pub struct FilePermissions(!);
4548

4649
pub struct FileType(!);
@@ -110,6 +113,11 @@ impl fmt::Debug for FilePermissions {
110113
}
111114
}
112115

116+
impl FileTimes {
117+
pub fn set_accessed(&mut self, _t: SystemTime) {}
118+
pub fn set_modified(&mut self, _t: SystemTime) {}
119+
}
120+
113121
impl FileType {
114122
pub fn is_dir(&self) -> bool {
115123
self.0
@@ -344,6 +352,10 @@ impl File {
344352
pub fn set_permissions(&self, _perm: FilePermissions) -> io::Result<()> {
345353
Err(Error::from_raw_os_error(22))
346354
}
355+
356+
pub fn set_times(&self, _times: FileTimes) -> io::Result<()> {
357+
Err(Error::from_raw_os_error(22))
358+
}
347359
}
348360

349361
impl DirBuilder {

0 commit comments

Comments
 (0)