Skip to content

Commit

Permalink
Merge pull request #1590 from hermit-os/ramfs-fstat
Browse files Browse the repository at this point in the history
feat(fs/mem): implement `fstat`
  • Loading branch information
stlankes authored Feb 7, 2025
2 parents d0adb81 + 5468e2a commit eaba655
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/fs/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ impl ObjectInterface for RomFileInterface {
Err(io::Error::EBADF)
}
}

async fn fstat(&self) -> io::Result<FileAttr> {
let guard = self.inner.read().await;
Ok(guard.attr)
}
}

impl RomFileInterface {
Expand Down Expand Up @@ -241,6 +246,11 @@ impl ObjectInterface for RamFileInterface {

Ok(new_pos)
}

async fn fstat(&self) -> io::Result<FileAttr> {
let guard = self.inner.read().await;
Ok(guard.attr)
}
}

impl RamFileInterface {
Expand Down

0 comments on commit eaba655

Please sign in to comment.