this was added so that posix_spawn and possibly other functionality could be implemented in terms of vfork, but that turned out to be unsafe. any such usage needs __clone with proper handling of stack lifetime.
@@ -1,9 +1,6 @@
.syntax unified
-.global __vfork
-.weak vfork
-.type __vfork,%function
+.global vfork
.type vfork,%function
-__vfork:
vfork:
mov ip, r7
mov r7, 190
@@ -1,8 +1,5 @@
-.type __vfork,@function
.type vfork,@function
pop %edx
mov $190,%eax
- .global __vfork
- .weak vfork
- .type __vfork,%function
+ .global vfork
svc 190
.hidden __syscall_ret
mov #95, r3
add r3, r3
@@ -2,9 +2,8 @@
#include <unistd.h>
#include <signal.h>
#include "syscall.h"
-#include "libc.h"
-pid_t __vfork(void)
+pid_t vfork(void)
{
/* vfork syscall cannot be made from C code */
#ifdef SYS_fork
@@ -13,5 +12,3 @@ pid_t __vfork(void)
return syscall(SYS_clone, SIGCHLD, 0);
#endif
}
-
-weak_alias(__vfork, vfork);
pop %rdx
mov $0x4000003a,%eax /* SYS_vfork */
mov $58,%eax