diff options
Diffstat (limited to 'src/thread/nt64')
-rw-r--r-- | src/thread/nt64/clone.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/thread/nt64/clone.c b/src/thread/nt64/clone.c index c3a968b..6f11d17 100644 --- a/src/thread/nt64/clone.c +++ b/src/thread/nt64/clone.c @@ -1,4 +1,7 @@ +#define _GNU_SOURCE + #include <syscall.h> +#include <sched.h> /* take advantage of winnt's x64 vararg abi */ #define __clone ____clone @@ -60,6 +63,17 @@ hidden int __clone( pfn_clone = (__sys_clone *)(__syscall_vtbl[SYS_clone]); + if (flags == CLONE_VM|CLONE_VFORK|SIGCHLD) { + regs.sbase = 0; + regs.slimit = 0; + regs.sbottom = 0; + + return (int)pfn_clone( + flags, + child_stack, + 0,0,®s); + } + pthread = (pthread_t)pthread_self_addr; regs.sbase = (unsigned long)pthread->stack; regs.slimit = regs.sbase - pthread->stack_size; |