this.write_scalar(stack_size, dest)?;
}
+ // Threading
+ "pthread_setname_np" => {
+ let ptr = this.read_scalar(args[0])?.not_undef()?;
+ this.pthread_setname_np(ptr)?;
+ }
+
// Incomplete shims that we "stub out" just to get pre-main initialization code to work.
// These shims are enabled only when the caller is in the standard library.
"mmap" if this.frame().instance.to_string().starts_with("std::sys::unix::") => {
_arg5: OpTy<'tcx, Tag>,
) -> InterpResult<'tcx, i32> {
let this = self.eval_context_mut();
+ this.assert_target_os("linux", "prctl");
let option = this.read_scalar(option)?.to_i32()?;
if option == this.eval_libc_i32("PR_SET_NAME")? {
Ok(0)
}
+ fn pthread_setname_np(
+ &mut self,
+ ptr: Scalar<Tag>,
+ ) -> InterpResult<'tcx> {
+ let this = self.eval_context_mut();
+ this.assert_target_os("macos", "pthread_setname_np");
+
+ let name = this.memory.read_c_str(ptr)?.to_owned();
+ this.set_active_thread_name(name)?;
+
+ Ok(())
+ }
+
fn sched_yield(&mut self) -> InterpResult<'tcx, i32> {
let this = self.eval_context_mut();