rename platform specific shims

This commit is contained in:
Christian Poveda 2020-02-19 17:53:33 -05:00
parent 3418b40dac
commit bb3a711b3e
No known key found for this signature in database
GPG key ID: 27525EF5E7420A50
3 changed files with 14 additions and 14 deletions

View file

@ -57,7 +57,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
id if id == sys_statx => {
// The first argument is the syscall id,
// so skip over it.
let result = this.statx(args[1], args[2], args[3], args[4], args[5])?;
let result = this.linux_statx(args[1], args[2], args[3], args[4], args[5])?;
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
}
id => throw_unsup_format!("miri does not support syscall ID {}", id),

View file

@ -25,17 +25,17 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
}
"stat$INODE64" => {
let result = this.stat(args[0], args[1])?;
let result = this.macos_stat(args[0], args[1])?;
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
}
"lstat$INODE64" => {
let result = this.lstat(args[0], args[1])?;
let result = this.macos_lstat(args[0], args[1])?;
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
}
"fstat$INODE64" => {
let result = this.fstat(args[0], args[1])?;
let result = this.macos_fstat(args[0], args[1])?;
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
}

View file

@ -340,7 +340,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
this.try_unwrap_io_result(create_link(target, linkpath).map(|_| 0))
}
fn stat(
fn macos_stat(
&mut self,
path_op: OpTy<'tcx, Tag>,
buf_op: OpTy<'tcx, Tag>,
@ -349,11 +349,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
this.check_no_isolation("stat")?;
this.check_platform("macos", "stat")?;
// `stat` always follows symlinks.
this.stat_or_lstat(true, path_op, buf_op)
this.macos_stat_or_lstat(true, path_op, buf_op)
}
// `lstat` is used to get symlink metadata.
fn lstat(
fn macos_lstat(
&mut self,
path_op: OpTy<'tcx, Tag>,
buf_op: OpTy<'tcx, Tag>,
@ -361,10 +361,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
let this = self.eval_context_mut();
this.check_no_isolation("lstat")?;
this.check_platform("macos", "lstat")?;
this.stat_or_lstat(false, path_op, buf_op)
this.macos_stat_or_lstat(false, path_op, buf_op)
}
fn fstat(
fn macos_fstat(
&mut self,
fd_op: OpTy<'tcx, Tag>,
buf_op: OpTy<'tcx, Tag>,
@ -380,10 +380,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
Some(metadata) => metadata,
None => return Ok(-1),
};
stat_macos_write_buf(this, metadata, buf_op)
macos_stat_write_buf(this, metadata, buf_op)
}
fn stat_or_lstat(
fn macos_stat_or_lstat(
&mut self,
follow_symlink: bool,
path_op: OpTy<'tcx, Tag>,
@ -398,10 +398,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
Some(metadata) => metadata,
None => return Ok(-1),
};
stat_macos_write_buf(this, metadata, buf_op)
macos_stat_write_buf(this, metadata, buf_op)
}
fn statx(
fn linux_statx(
&mut self,
dirfd_op: OpTy<'tcx, Tag>, // Should be an `int`
pathname_op: OpTy<'tcx, Tag>, // Should be a `const char *`
@ -688,7 +688,7 @@ impl FileMetadata {
}
}
fn stat_macos_write_buf<'tcx, 'mir>(
fn macos_stat_write_buf<'tcx, 'mir>(
ecx: &mut MiriEvalContext<'mir, 'tcx>,
metadata: FileMetadata,
buf_op: OpTy<'tcx, Tag>,