blob: 7b624498a055336a6ca1375047b8ac667efd84a7 [file] [log] [blame]
Elliott Hughesbdff26d2013-02-11 17:08:16 -08001#include <machine/asm.h>
Elliott Hughes5c2772f2013-03-21 22:15:06 -07002#include <asm/unistd.h>
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08003
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08004/* Get rid of the stack modifications (popl/ret) after vfork() success.
5 * vfork is VERY sneaky. One has to be very careful about what can be done
6 * between a successful vfork and a a subsequent execve()
7 */
8
Elliott Hughesbdff26d2013-02-11 17:08:16 -08009ENTRY(vfork)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080010 /* grab the return address */
11 popl %ecx
12 movl $__NR_vfork, %eax
13 int $0x80
14 cmpl $-129, %eax
15 jb 1f
16 negl %eax
17 pushl %eax
18 call __set_errno
19 orl $-1, %eax
201:
21 jmp *%ecx
Elliott Hughesbdff26d2013-02-11 17:08:16 -080022END(vfork)