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 19, 2023
1 parent c5ff721 commit d78cfcb
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 110 deletions.
17 changes: 5 additions & 12 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1585,6 +1585,10 @@ name = "hermit-abi"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b"

[[package]]
name = "hermit-abi"
version = "0.3.3"
dependencies = [
"compiler_builtins",
"rustc-std-workspace-alloc",
Expand Down Expand Up @@ -1953,14 +1957,8 @@ version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb"
dependencies = [
<<<<<<< HEAD
"hermit-abi 0.3.2",
"rustix 0.38.2",
=======
"hermit-abi 0.3.1",
"io-lifetimes",
"rustix",
>>>>>>> 3435df2bc6c (define hermit_abi as public depedenceny)
"windows-sys 0.48.0",
]

Expand Down Expand Up @@ -4945,13 +4943,8 @@ dependencies = [
"core",
"dlmalloc",
"fortanix-sgx-abi",
<<<<<<< HEAD
"hashbrown 0.14.0",
"hermit-abi 0.3.2",
=======
"hashbrown 0.13.1",
"hermit-abi 0.3.1",
>>>>>>> 3435df2bc6c (define hermit_abi as public depedenceny)
"hermit-abi 0.3.3",
"libc",
"miniz_oxide",
"object",
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 d78cfcb

Please sign in to comment.