Skip to content

Commit 259c3cc

Browse files
simonschoeningstlankes
authored andcommitted
Extending filesystem support for hermit-os
1 parent 15ca08a commit 259c3cc

File tree

4 files changed

+233
-110
lines changed

4 files changed

+233
-110
lines changed

Cargo.lock

+1-12
Original file line numberDiff line numberDiff line change
@@ -1975,17 +1975,6 @@ dependencies = [
19751975
"unic-langid",
19761976
]
19771977

1978-
[[package]]
1979-
name = "io-lifetimes"
1980-
version = "1.0.11"
1981-
source = "registry+https://github.com/rust-lang/crates.io-index"
1982-
checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2"
1983-
dependencies = [
1984-
"hermit-abi 0.3.3",
1985-
"libc",
1986-
"windows-sys 0.48.0",
1987-
]
1988-
19891978
[[package]]
19901979
name = "ipnet"
19911980
version = "2.7.2"
@@ -1999,7 +1988,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
19991988
checksum = "24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb"
20001989
dependencies = [
20011990
"hermit-abi 0.3.3",
2002-
"rustix 0.38.2",
1991+
"rustix",
20031992
"windows-sys 0.48.0",
20041993
]
20051994

library/std/src/sys/hermit/fd.rs

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ impl FileDesc {
4848
pub fn set_nonblocking(&self, _nonblocking: bool) -> io::Result<()> {
4949
unsupported()
5050
}
51+
52+
pub fn fstat(&self, stat: *mut abi::stat) -> io::Result<()> {
53+
cvt(unsafe { abi::fstat(self.fd.as_raw_fd(), stat) })?;
54+
Ok(())
55+
}
5156
}
5257

5358
impl<'a> Read for &'a FileDesc {

0 commit comments

Comments
 (0)