mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 06:28:20 +03:00
promote open and lseek shims to posix
This commit is contained in:
@@ -45,6 +45,11 @@ fn emulate_foreign_item_by_name(
|
||||
}
|
||||
|
||||
// File related shims
|
||||
"open" | "open64" => {
|
||||
let result = this.open(args[0], args[1])?;
|
||||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
|
||||
"fcntl" => {
|
||||
let result = this.fcntl(args[0], args[1], args.get(2).cloned())?;
|
||||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
@@ -104,6 +109,11 @@ fn emulate_foreign_item_by_name(
|
||||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
|
||||
"lseek" | "lseek64" => {
|
||||
let result = this.lseek64(args[0], args[1], args[2])?;
|
||||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
|
||||
// Other shims
|
||||
"posix_memalign" => {
|
||||
let ret = this.deref_operand(args[0])?;
|
||||
|
||||
@@ -19,21 +19,11 @@ fn emulate_foreign_item_by_name(
|
||||
}
|
||||
|
||||
// File related shims
|
||||
"open64" => {
|
||||
let result = this.open(args[0], args[1])?;
|
||||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
|
||||
"close" => {
|
||||
let result = this.close(args[0])?;
|
||||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
|
||||
"lseek64" => {
|
||||
let result = this.lseek64(args[0], args[1], args[2])?;
|
||||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
|
||||
// Time related shims
|
||||
"clock_gettime" => {
|
||||
let result = this.clock_gettime(args[0], args[1])?;
|
||||
|
||||
@@ -19,11 +19,6 @@ fn emulate_foreign_item_by_name(
|
||||
}
|
||||
|
||||
// File related shims
|
||||
"open" => {
|
||||
let result = this.open(args[0], args[1])?;
|
||||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
|
||||
"close$NOCANCEL" => {
|
||||
let result = this.close(args[0])?;
|
||||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
@@ -44,11 +39,6 @@ fn emulate_foreign_item_by_name(
|
||||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
|
||||
"lseek" => {
|
||||
let result = this.lseek64(args[0], args[1], args[2])?;
|
||||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
|
||||
// Time related shims
|
||||
"gettimeofday" => {
|
||||
let result = this.gettimeofday(args[0], args[1])?;
|
||||
|
||||
Reference in New Issue
Block a user