Move mmap64's implementation under "File related shims".
This commit is contained in:
parent
438f43c7a0
commit
064ad45bf7
1 changed files with 8 additions and 8 deletions
|
|
@ -44,6 +44,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
|
|||
let result = this.linux_readdir64(dirp)?;
|
||||
this.write_scalar(result, dest)?;
|
||||
}
|
||||
"mmap64" => {
|
||||
let [addr, length, prot, flags, fd, offset] =
|
||||
this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
|
||||
let offset = this.read_scalar(offset)?.to_i64()?;
|
||||
let ptr = this.mmap(addr, length, prot, flags, fd, offset.into())?;
|
||||
this.write_scalar(ptr, dest)?;
|
||||
}
|
||||
|
||||
// Linux-only
|
||||
"sync_file_range" => {
|
||||
let [fd, offset, nbytes, flags] =
|
||||
|
|
@ -218,14 +226,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
|
|||
this.write_null(dest)?;
|
||||
}
|
||||
|
||||
"mmap64" => {
|
||||
let [addr, length, prot, flags, fd, offset] =
|
||||
this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
|
||||
let offset = this.read_scalar(offset)?.to_i64()?;
|
||||
let ptr = this.mmap(addr, length, prot, flags, fd, offset.into())?;
|
||||
this.write_scalar(ptr, dest)?;
|
||||
}
|
||||
|
||||
_ => return Ok(EmulateForeignItemResult::NotSupported),
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue