Skip to content

Commit e6e294a

Browse files
committed
Auto merge of rust-lang#3748 - RalfJung:freebsd-readdir, r=RalfJung
readdir_r shim: assume FreeBSD v12+ Blocked on rust-lang/libc#3723 being released and propagating to std.
2 parents 0305cee + 221932f commit e6e294a

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/tools/miri/src/shims/unix/fs.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,14 +1204,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
12041204
)?;
12051205
}
12061206
"freebsd" => {
1207-
this.write_int(ino, &this.project_field_named(&entry_place, "d_fileno")?)?;
1208-
// `d_off` only exists on FreeBSD 12+, but we support v11 as well.
1209-
// `libc` uses a build script to determine which version of the API to use,
1210-
// and cross-builds always end up using v11.
1211-
// To support both v11 and v12+, we dynamically check whether the field exists.
1212-
if this.projectable_has_field(&entry_place, "d_off") {
1213-
this.write_int(0, &this.project_field_named(&entry_place, "d_off")?)?;
1214-
}
1207+
#[rustfmt::skip]
1208+
this.write_int_fields_named(
1209+
&[
1210+
("d_fileno", ino.into()),
1211+
("d_off", 0),
1212+
],
1213+
&entry_place,
1214+
)?;
12151215
}
12161216
_ => unreachable!(),
12171217
}

src/tools/miri/test_dependencies/Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ dependencies = [
119119

120120
[[package]]
121121
name = "libc"
122-
version = "0.2.155"
122+
version = "0.2.158"
123123
source = "registry+https://github.com/rust-lang/crates.io-index"
124-
checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
124+
checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439"
125125

126126
[[package]]
127127
name = "linux-raw-sys"

0 commit comments

Comments
 (0)