Add __error to freebsd shims

Signed-off-by: InfRandomness <infrandomness@gmail.com>
This commit is contained in:
InfRandomness
2022-07-01 18:36:14 +02:00
parent 38effb37da
commit dca2bb68b3
+8
View File
@@ -24,6 +24,14 @@ fn emulate_foreign_item_by_name(
this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
this.write_null(dest)?;
}
// errno
"__error" => {
let [] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
let errno_place = this.last_error_place()?;
this.write_scalar(errno_place.to_ref(this).to_scalar()?, dest)?;
}
_ => return Ok(EmulateByNameResult::NotSupported),
}
Ok(EmulateByNameResult::NeedsJumping)