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
No known key found for this signature in database
GPG key ID: 60B6C81EF033441A

View file

@ -24,6 +24,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
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)