2 Copyright © 2008, The AROS Development Team. All rights reserved.
5 Desc: POSIX function vfork()
9 /******************************************************************************
34 ******************************************************************************/
36 #include "aros/x86_64/asm.h"
40 .globl AROS_CDEFNAME(vfork)
41 _FUNCTION
(AROS_CDEFNAME
(vfork
))
47 lea
(-bufsize
)(%rsp
), %rsp
/* _JMPLEN + 1 longs on the stack
48 it's our temporary jmp_buf */
50 call setjmp
/* fill jmp_buf on the stack with
51 current register values */
52 mov bufsize
(%rsp
), %rax
/* set return address in jmp_buf */
53 mov
%rax
, 0(%rdi
) /* to this function call return
55 lea bufsize
(%rsp
), %rax
/* set stack value in jmp_buf */
56 mov
%rax
, 120(%rdi
) /* this function call */
57 call __vfork
/* __vfork call won't return */