remove readdir_r on FreeBSD: it is deprecated, unused, and untested
This commit is contained in:
parent
e7650fd821
commit
44aaae38ac
3 changed files with 5 additions and 36 deletions
|
|
@ -153,12 +153,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
let result = this.fstat(fd, buf)?;
|
||||
this.write_scalar(result, dest)?;
|
||||
}
|
||||
"readdir_r" | "readdir_r@FBSD_1.0" => {
|
||||
let [dirp, entry, result] =
|
||||
this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?;
|
||||
let result = this.macos_fbsd_readdir_r(dirp, entry, result)?;
|
||||
this.write_scalar(result, dest)?;
|
||||
}
|
||||
"readdir" | "readdir@FBSD_1.0" => {
|
||||
let [dirp] = this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?;
|
||||
let result = this.readdir64("dirent", dirp)?;
|
||||
|
|
|
|||
|
|
@ -1030,7 +1030,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
interp_ok(Scalar::from_maybe_pointer(entry.unwrap_or_else(Pointer::null), this))
|
||||
}
|
||||
|
||||
fn macos_fbsd_readdir_r(
|
||||
fn macos_readdir_r(
|
||||
&mut self,
|
||||
dirp_op: &OpTy<'tcx>,
|
||||
entry_op: &OpTy<'tcx>,
|
||||
|
|
@ -1038,9 +1038,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
) -> InterpResult<'tcx, Scalar> {
|
||||
let this = self.eval_context_mut();
|
||||
|
||||
if !matches!(&this.tcx.sess.target.os, Os::MacOs | Os::FreeBsd) {
|
||||
panic!("`macos_fbsd_readdir_r` should not be called on {}", this.tcx.sess.target.os);
|
||||
}
|
||||
this.assert_target_os(Os::MacOs, "readdir_r");
|
||||
|
||||
let dirp = this.read_target_usize(dirp_op)?;
|
||||
let result_place = this.deref_pointer_as(result_op, this.machine.layouts.mut_raw_ptr)?;
|
||||
|
|
@ -1096,39 +1094,16 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
|
||||
let file_type = this.file_type_to_d_type(dir_entry.file_type())?;
|
||||
|
||||
// Common fields.
|
||||
this.write_int_fields_named(
|
||||
&[
|
||||
("d_reclen", 0),
|
||||
("d_namlen", file_name_len.into()),
|
||||
("d_type", file_type.into()),
|
||||
("d_ino", ino.into()),
|
||||
("d_seekoff", 0),
|
||||
],
|
||||
&entry_place,
|
||||
)?;
|
||||
// Special fields.
|
||||
match this.tcx.sess.target.os {
|
||||
Os::MacOs => {
|
||||
#[rustfmt::skip]
|
||||
this.write_int_fields_named(
|
||||
&[
|
||||
("d_ino", ino.into()),
|
||||
("d_seekoff", 0),
|
||||
],
|
||||
&entry_place,
|
||||
)?;
|
||||
}
|
||||
Os::FreeBsd => {
|
||||
#[rustfmt::skip]
|
||||
this.write_int_fields_named(
|
||||
&[
|
||||
("d_fileno", ino.into()),
|
||||
("d_off", 0),
|
||||
],
|
||||
&entry_place,
|
||||
)?;
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
this.write_scalar(this.read_scalar(entry_op)?, &result_place)?;
|
||||
|
||||
Scalar::from_i32(0)
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
"readdir_r" | "readdir_r$INODE64" => {
|
||||
let [dirp, entry, result] =
|
||||
this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?;
|
||||
let result = this.macos_fbsd_readdir_r(dirp, entry, result)?;
|
||||
let result = this.macos_readdir_r(dirp, entry, result)?;
|
||||
this.write_scalar(result, dest)?;
|
||||
}
|
||||
"realpath$DARWIN_EXTSN" => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue