Rollup merge of #162079 - stlankes:sync, r=joboet

std: implement `File::fsync` for Hermit

- hermit-abi 0.5.3 exposes `fsync`, so the operation no longer has to return `Unsupported`.

cc: @mkroening
This commit is contained in:
Jonathan Brouwer
2026-09-01 13:27:46 +02:00
committed by GitHub
3 changed files with 5 additions and 4 deletions

View File

@@ -143,9 +143,9 @@ dependencies = [
[[package]]
name = "hermit-abi"
version = "0.5.2"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284"
dependencies = [
"rustc-std-workspace-alloc",
"rustc-std-workspace-core",

View File

@@ -74,7 +74,7 @@ fortanix-sgx-abi = { version = "0.6.1", features = [
moto-rt = { version = "0.17", features = ['rustc-dep-of-std'], public = true }
[target.'cfg(target_os = "hermit")'.dependencies]
hermit-abi = { version = "0.5.0", features = [
hermit-abi = { version = "0.5.3", features = [
'rustc-dep-of-std',
], public = true }

View File

@@ -411,7 +411,8 @@ impl File {
}
pub fn fsync(&self) -> io::Result<()> {
unsupported()
unsafe { cvt(hermit_abi::fsync(self.as_raw_fd()))? };
Ok(())
}
pub fn datasync(&self) -> io::Result<()> {