Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extending filesystem support for Hermit #115984

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions library/std/src/sys/pal/hermit/fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ impl FileDesc {
pub fn set_nonblocking(&self, _nonblocking: bool) -> io::Result<()> {
unsupported()
}

pub fn fstat(&self, stat: *mut abi::stat) -> io::Result<()> {
cvt(unsafe { abi::fstat(self.fd.as_raw_fd(), stat) })?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...Why did I have to trace through three different directories just to discover that this is referring to the hermit_abi crate? That is so confusing.

Copy link
Contributor Author

@stlankes stlankes Mar 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excuse me for my late response.

I am a little bit confused. Why do you have trace three different directories? Do you mean I should move fstat from from fd.rs to fs.rs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or do you want that rename abi to hermit-abi? Maybe it is easier to understand...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I was a bit confused by the levels of indirection in general, but yes, I think probably using hermit_abi might be a bit clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I would prefer to create an additional PR for these changes because I have to touch every file in library/std/src/sys/pal/hermit/. In addition, it doesn't belong to this PR.

Ok(())
}
}

impl<'a> Read for &'a FileDesc {
Expand Down
Loading
Loading