Skip to content

Commit 2f4b32a

Browse files
committed
Auto merge of #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 b355d81 + 1ed6e50 commit 2f4b32a

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Diff for: src/shims/unix/fs.rs

+8-8
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
}

Diff for: test_dependencies/Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)