also allow illumos to use mmap for its stack guard

This commit is contained in:
Ralf Jung 2024-09-11 10:03:13 +02:00
parent 19fa141a6d
commit 7e6ce60ffb

View File

@ -42,10 +42,10 @@ fn mmap(
let map_shared = this.eval_libc_i32("MAP_SHARED");
let map_fixed = this.eval_libc_i32("MAP_FIXED");
// This is a horrible hack, but on MacOS and Solaris the guard page mechanism uses mmap
// This is a horrible hack, but on MacOS and Solarish the guard page mechanism uses mmap
// in a way we do not support. We just give it the return value it expects.
if this.frame_in_std()
&& matches!(&*this.tcx.sess.target.os, "macos" | "solaris")
&& matches!(&*this.tcx.sess.target.os, "macos" | "solaris" | "illumos")
&& (flags & map_fixed) != 0
{
return Ok(Scalar::from_maybe_pointer(Pointer::from_addr_invalid(addr), this));