From 0758af3ae7093e59865d8301cb6400a1e1f7e86a Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 18 Aug 2024 10:38:34 +0200 Subject: [PATCH] readdir_r shim: assume FreeBSD v12+ needs a libc version bump --- src/shims/unix/fs.rs | 16 ++++++++-------- test_dependencies/Cargo.lock | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/shims/unix/fs.rs b/src/shims/unix/fs.rs index 80f4b89bf3..e00758bb98 100644 --- a/src/shims/unix/fs.rs +++ b/src/shims/unix/fs.rs @@ -1204,14 +1204,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { )?; } "freebsd" => { - this.write_int(ino, &this.project_field_named(&entry_place, "d_fileno")?)?; - // `d_off` only exists on FreeBSD 12+, but we support v11 as well. - // `libc` uses a build script to determine which version of the API to use, - // and cross-builds always end up using v11. - // To support both v11 and v12+, we dynamically check whether the field exists. - if this.projectable_has_field(&entry_place, "d_off") { - this.write_int(0, &this.project_field_named(&entry_place, "d_off")?)?; - } + #[rustfmt::skip] + this.write_int_fields_named( + &[ + ("d_fileno", ino.into()), + ("d_off", 0), + ], + &entry_place, + )?; } _ => unreachable!(), } diff --git a/test_dependencies/Cargo.lock b/test_dependencies/Cargo.lock index e94bef5295..2834088c81 100644 --- a/test_dependencies/Cargo.lock +++ b/test_dependencies/Cargo.lock @@ -119,9 +119,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.155" +version = "0.2.157" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "374af5f94e54fa97cf75e945cce8a6b201e88a1a07e688b47dfd2a59c66dbd86" [[package]] name = "linux-raw-sys"