posix_fadvise is Linux-only; also validate arguments a bit
This commit is contained in:
parent
9e39bfbbd9
commit
6ab82f5d35
2 changed files with 9 additions and 4 deletions
|
|
@ -115,10 +115,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||
let result = this.lseek64(args[0], args[1], args[2])?;
|
||||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
"posix_fadvise" => {
|
||||
// fadvise is only informational, we can ignore it.
|
||||
this.write_null(dest)?;
|
||||
}
|
||||
|
||||
// Allocation
|
||||
"posix_memalign" => {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,15 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||
let result = this.linux_readdir64_r(args[0], args[1], args[2])?;
|
||||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
// Linux-only
|
||||
"posix_fadvise" => {
|
||||
let _fd = this.read_scalar(args[0])?.to_i32()?;
|
||||
let _offset = this.read_scalar(args[1])?.to_machine_isize(this)?;
|
||||
let _len = this.read_scalar(args[2])?.to_machine_isize(this)?;
|
||||
let _advice = this.read_scalar(args[3])?.to_i32()?;
|
||||
// fadvise is only informational, we can ignore it.
|
||||
this.write_null(dest)?;
|
||||
}
|
||||
|
||||
// Time related shims
|
||||
"clock_gettime" => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue