Skip to content

Commit dca2bb6

Browse files
committed
Add __error to freebsd shims
Signed-off-by: InfRandomness <[email protected]>
1 parent 38effb3 commit dca2bb6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/shims/unix/freebsd/foreign_items.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
2424
this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
2525
this.write_null(dest)?;
2626
}
27+
28+
// errno
29+
"__error" => {
30+
let [] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
31+
let errno_place = this.last_error_place()?;
32+
this.write_scalar(errno_place.to_ref(this).to_scalar()?, dest)?;
33+
}
34+
2735
_ => return Ok(EmulateByNameResult::NotSupported),
2836
}
2937
Ok(EmulateByNameResult::NeedsJumping)

0 commit comments

Comments
 (0)