提交 ced75472 编写于 作者: R Rich Felker

remove __vfork alias

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.
上级 6d47488e
.syntax unified
.global __vfork
.weak vfork
.type __vfork,%function
.global vfork
.type vfork,%function
__vfork:
vfork:
mov ip, r7
mov r7, 190
......
.global __vfork
.weak vfork
.type __vfork,@function
.global vfork
.type vfork,@function
__vfork:
vfork:
pop %edx
mov $190,%eax
......
.global __vfork
.weak vfork
.type __vfork,%function
.global vfork
.type vfork,%function
__vfork:
vfork:
svc 190
.hidden __syscall_ret
......
.global __vfork
.weak vfork
.type __vfork,@function
.global vfork
.type vfork,@function
__vfork:
vfork:
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);
.global __vfork
.weak vfork
.type __vfork,@function
.global vfork
.type vfork,@function
__vfork:
vfork:
pop %rdx
mov $0x4000003a,%eax /* SYS_vfork */
......
.global __vfork
.weak vfork
.type __vfork,@function
.global vfork
.type vfork,@function
__vfork:
vfork:
pop %rdx
mov $58,%eax
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册