diff options
author | midipix <writeonce@midipix.org> | 2019-04-03 21:20:08 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2019-04-03 21:20:08 -0400 |
commit | 9912f3a537d96b41ae2b76d90215971e39f24a7e (patch) | |
tree | 82086e2573cd10c0278ec7109af30998440e2e04 /src/thread/nt32 | |
parent | 8576ddb6e5a39422b9ac18625954df47f44f302a (diff) | |
download | mmglue-9912f3a537d96b41ae2b76d90215971e39f24a7e.tar.bz2 mmglue-9912f3a537d96b41ae2b76d90215971e39f24a7e.tar.xz |
__clone(): properly handle four-argument (vfork mode) invocations.
Diffstat (limited to 'src/thread/nt32')
-rw-r--r-- | src/thread/nt32/clone.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/thread/nt32/clone.c b/src/thread/nt32/clone.c index f5ad5f8..12d7e5e 100644 --- a/src/thread/nt32/clone.c +++ b/src/thread/nt32/clone.c @@ -1,4 +1,7 @@ +#define _GNU_SOURCE + #include <syscall.h> +#include <sched.h> /* take advantage of i686 vararg abi */ #define __clone ____clone @@ -56,6 +59,17 @@ 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; |