On Monday, 6 June 2022 at 15:13:45 UTC, rempas wrote:
void* code = mmap(null, cast(ulong)500, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0);
On a lot of systems, it can't be executable and writable at the same time, it is a security measure.
see https://en.wikipedia.org/wiki/W%5EXso you might have to mprotect it to remove the write permission before trying to execute it.
idk though