Rollup merge of #101422 - mkroening:hermit-file-time, r=joshtriplett

Hermit: Add File::set_time stub

This is not supported on hermit yet. This change is required for compiling std.
This commit is contained in:
Dylan DPC 2022-09-08 11:55:07 +05:30 committed by GitHub
commit 7064344ba4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,6 +41,9 @@ pub struct OpenOptions {
mode: i32, mode: i32,
} }
#[derive(Copy, Clone, Debug, Default)]
pub struct FileTimes {}
pub struct FilePermissions(!); pub struct FilePermissions(!);
pub struct FileType(!); pub struct FileType(!);
@ -110,6 +113,11 @@ fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
} }
} }
impl FileTimes {
pub fn set_accessed(&mut self, _t: SystemTime) {}
pub fn set_modified(&mut self, _t: SystemTime) {}
}
impl FileType { impl FileType {
pub fn is_dir(&self) -> bool { pub fn is_dir(&self) -> bool {
self.0 self.0
@ -344,6 +352,10 @@ pub fn duplicate(&self) -> io::Result<File> {
pub fn set_permissions(&self, _perm: FilePermissions) -> io::Result<()> { pub fn set_permissions(&self, _perm: FilePermissions) -> io::Result<()> {
Err(Error::from_raw_os_error(22)) 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 { impl DirBuilder {