Skip to content

Commit

Permalink
Extending filesystem support for hermit-os
Browse files Browse the repository at this point in the history
  • Loading branch information
simonschoening authored and stlankes committed Sep 26, 2023
1 parent 15ca08a commit 259c3cc
Show file tree
Hide file tree
Showing 4 changed files with 233 additions and 110 deletions.
13 changes: 1 addition & 12 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1975,17 +1975,6 @@ dependencies = [
"unic-langid",
]

[[package]]
name = "io-lifetimes"
version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2"
dependencies = [
"hermit-abi 0.3.3",
"libc",
"windows-sys 0.48.0",
]

[[package]]
name = "ipnet"
version = "2.7.2"
Expand All @@ -1999,7 +1988,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb"
dependencies = [
"hermit-abi 0.3.3",
"rustix 0.38.2",
"rustix",
"windows-sys 0.48.0",
]

Expand Down
5 changes: 5 additions & 0 deletions library/std/src/sys/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) })?;
Ok(())
}
}

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

0 comments on commit 259c3cc

Please sign in to comment.