Auto merge of #3748 - RalfJung:freebsd-readdir, r=RalfJung

readdir_r shim: assume FreeBSD v12+

Blocked on https://github.com/rust-lang/libc/pull/3723 being released and propagating to std.
This commit is contained in:
bors 2024-08-20 10:21:05 +00:00
commit e6e294abab
2 changed files with 10 additions and 10 deletions

View File

@ -1204,14 +1204,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
)?; )?;
} }
"freebsd" => { "freebsd" => {
this.write_int(ino, &this.project_field_named(&entry_place, "d_fileno")?)?; #[rustfmt::skip]
// `d_off` only exists on FreeBSD 12+, but we support v11 as well. this.write_int_fields_named(
// `libc` uses a build script to determine which version of the API to use, &[
// and cross-builds always end up using v11. ("d_fileno", ino.into()),
// To support both v11 and v12+, we dynamically check whether the field exists. ("d_off", 0),
if this.projectable_has_field(&entry_place, "d_off") { ],
this.write_int(0, &this.project_field_named(&entry_place, "d_off")?)?; &entry_place,
} )?;
} }
_ => unreachable!(), _ => unreachable!(),
} }

View File

@ -119,9 +119,9 @@ dependencies = [
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.155" version = "0.2.158"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439"
[[package]] [[package]]
name = "linux-raw-sys" name = "linux-raw-sys"