about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-08-18 10:38:34 +0200
committerRalf Jung <post@ralfj.de>2024-08-20 12:11:10 +0200
commit221932fc4dc443fd741822d08a65705d60e8773b (patch)
tree54175a79c12444b9f2b046242bfc9d619be5bec8 /src
parent0305cee39a27b8a9a59b5c7ec978f17420c4bee8 (diff)
downloadrust-221932fc4dc443fd741822d08a65705d60e8773b.tar.gz
rust-221932fc4dc443fd741822d08a65705d60e8773b.zip
readdir_r shim: assume FreeBSD v12+
needs a libc version bump
Diffstat (limited to 'src')
-rw-r--r--src/tools/miri/src/shims/unix/fs.rs16
-rw-r--r--src/tools/miri/test_dependencies/Cargo.lock4
2 files changed, 10 insertions, 10 deletions
diff --git a/src/tools/miri/src/shims/unix/fs.rs b/src/tools/miri/src/shims/unix/fs.rs
index 80f4b89bf34..e00758bb98d 100644
--- a/src/tools/miri/src/shims/unix/fs.rs
+++ b/src/tools/miri/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/src/tools/miri/test_dependencies/Cargo.lock b/src/tools/miri/test_dependencies/Cargo.lock
index e94bef52952..bbead878223 100644
--- a/src/tools/miri/test_dependencies/Cargo.lock
+++ b/src/tools/miri/test_dependencies/Cargo.lock
@@ -119,9 +119,9 @@ dependencies = [
 
 [[package]]
 name = "libc"
-version = "0.2.155"
+version = "0.2.158"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
+checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439"
 
 [[package]]
 name = "linux-raw-sys"