From 271ae0fb18edcb0f8b7bbe8c496477438fd6ec95 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sun, 2 Feb 2025 15:17:52 +0100 Subject: [PATCH] Added stack specific flags for thread stack allocation --- lib/thread/{thread.q => thread_linux.q} | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename lib/thread/{thread.q => thread_linux.q} (74%) diff --git a/lib/thread/thread.q b/lib/thread/thread_linux.q similarity index 74% rename from lib/thread/thread.q rename to lib/thread/thread_linux.q index d2b2b73..eaa873b 100644 --- a/lib/thread/thread.q +++ b/lib/thread/thread_linux.q @@ -1,9 +1,8 @@ -import mem import sys create(func Pointer) -> Int { size := 4096 - stack := mem.alloc(size) + stack := sys.mmap(0, size, 0x1|0x2, 0x02|0x20|0x100|0x20000) rip := stack + size - 8 store(rip, 8, func) return sys.clone(0x100|0x200|0x400|0x800|0x8000|0x10000|0x80000000, rip)