Skip to content

Commit 8bc65aa

Browse files
committed
Add __errno_location shim
1 parent ca873e0 commit 8bc65aa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/shims/foreign_items.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
418418
}
419419
}
420420

421+
"__errno_location" => {
422+
let errno_scalar: Scalar<Tag> = this.machine.last_error.unwrap().into();
423+
this.write_scalar(errno_scalar, dest)?;
424+
}
425+
421426
"getenv" => {
422427
let result = this.getenv(args[0])?;
423428
this.write_scalar(result, dest)?;

0 commit comments

Comments
 (0)