Don't use vfork() on XNU (#426)

This commit is contained in:
Justine Tunney 2022-06-23 01:18:47 -07:00
parent 1235ad6006
commit 2415afab0e
2 changed files with 5 additions and 1 deletions

View file

@ -44,6 +44,10 @@ vfork:
testb IsWindows()
jnz sys_fork_nt # and we're lucky to have that
#endif
#if SupportsXnu()
testb IsXnu()
jnz fork
#endif
#if SupportsOpenbsd()
testb IsOpenbsd()
jnz fork # fake vfork plus msyscall issues

View file

@ -92,7 +92,7 @@ scall __sys_socketpair 0x0870870872087035 globl hidden
scall sys_setsockopt 0x0690690692069036 globl hidden
scall sys_getsockopt 0x0760760762076037 globl hidden
scall sys_fork 0x0020020022002039 globl hidden # xnu needs eax&=~-edx bc eax always holds pid and edx is 0 for parent and 1 for child
#scall vfork 0x042042042204203a globl # this syscall is from the moon so we implement it by hand in libc/runtime/vfork.S
#scall vfork 0x042042042204203a globl # this syscall is from the moon so we implement it by hand in libc/runtime/vfork.S; probably removed from XNU in 12.5
scall sys_posix_spawn 0xfffffffff20f4fff globl hidden # good luck figuring out how xnu defines this
scall __sys_execve 0x03b03b03b203b03b globl hidden
scall __sys_wait4 0x1c100b007200703d globl hidden