Skip to content

Commit bb3a711

Browse files
committed
rename platform specific shims
1 parent 3418b40 commit bb3a711

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/shims/foreign_items/posix/linux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
5757
id if id == sys_statx => {
5858
// The first argument is the syscall id,
5959
// so skip over it.
60-
let result = this.statx(args[1], args[2], args[3], args[4], args[5])?;
60+
let result = this.linux_statx(args[1], args[2], args[3], args[4], args[5])?;
6161
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
6262
}
6363
id => throw_unsup_format!("miri does not support syscall ID {}", id),

src/shims/foreign_items/posix/macos.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
2525
}
2626

2727
"stat$INODE64" => {
28-
let result = this.stat(args[0], args[1])?;
28+
let result = this.macos_stat(args[0], args[1])?;
2929
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
3030
}
3131

3232
"lstat$INODE64" => {
33-
let result = this.lstat(args[0], args[1])?;
33+
let result = this.macos_lstat(args[0], args[1])?;
3434
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
3535
}
3636

3737
"fstat$INODE64" => {
38-
let result = this.fstat(args[0], args[1])?;
38+
let result = this.macos_fstat(args[0], args[1])?;
3939
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
4040
}
4141

src/shims/fs.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
340340
this.try_unwrap_io_result(create_link(target, linkpath).map(|_| 0))
341341
}
342342

343-
fn stat(
343+
fn macos_stat(
344344
&mut self,
345345
path_op: OpTy<'tcx, Tag>,
346346
buf_op: OpTy<'tcx, Tag>,
@@ -349,22 +349,22 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
349349
this.check_no_isolation("stat")?;
350350
this.check_platform("macos", "stat")?;
351351
// `stat` always follows symlinks.
352-
this.stat_or_lstat(true, path_op, buf_op)
352+
this.macos_stat_or_lstat(true, path_op, buf_op)
353353
}
354354

355355
// `lstat` is used to get symlink metadata.
356-
fn lstat(
356+
fn macos_lstat(
357357
&mut self,
358358
path_op: OpTy<'tcx, Tag>,
359359
buf_op: OpTy<'tcx, Tag>,
360360
) -> InterpResult<'tcx, i32> {
361361
let this = self.eval_context_mut();
362362
this.check_no_isolation("lstat")?;
363363
this.check_platform("macos", "lstat")?;
364-
this.stat_or_lstat(false, path_op, buf_op)
364+
this.macos_stat_or_lstat(false, path_op, buf_op)
365365
}
366366

367-
fn fstat(
367+
fn macos_fstat(
368368
&mut self,
369369
fd_op: OpTy<'tcx, Tag>,
370370
buf_op: OpTy<'tcx, Tag>,
@@ -380,10 +380,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
380380
Some(metadata) => metadata,
381381
None => return Ok(-1),
382382
};
383-
stat_macos_write_buf(this, metadata, buf_op)
383+
macos_stat_write_buf(this, metadata, buf_op)
384384
}
385385

386-
fn stat_or_lstat(
386+
fn macos_stat_or_lstat(
387387
&mut self,
388388
follow_symlink: bool,
389389
path_op: OpTy<'tcx, Tag>,
@@ -398,10 +398,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
398398
Some(metadata) => metadata,
399399
None => return Ok(-1),
400400
};
401-
stat_macos_write_buf(this, metadata, buf_op)
401+
macos_stat_write_buf(this, metadata, buf_op)
402402
}
403403

404-
fn statx(
404+
fn linux_statx(
405405
&mut self,
406406
dirfd_op: OpTy<'tcx, Tag>, // Should be an `int`
407407
pathname_op: OpTy<'tcx, Tag>, // Should be a `const char *`
@@ -688,7 +688,7 @@ impl FileMetadata {
688688
}
689689
}
690690

691-
fn stat_macos_write_buf<'tcx, 'mir>(
691+
fn macos_stat_write_buf<'tcx, 'mir>(
692692
ecx: &mut MiriEvalContext<'mir, 'tcx>,
693693
metadata: FileMetadata,
694694
buf_op: OpTy<'tcx, Tag>,

0 commit comments

Comments
 (0)