141012Swilliam/*- 2*61135Sbostic * Copyright (c) 1990, 1993 3*61135Sbostic * The Regents of the University of California. All rights reserved. 441012Swilliam * 541012Swilliam * This code is derived from software contributed to Berkeley by 641012Swilliam * William Jolitz. 741012Swilliam * 841012Swilliam * %sccs.include.redist.c% 941012Swilliam */ 1041012Swilliam 1141012Swilliam#if defined(SYSLIBC_SCCS) && !defined(lint) 12*61135Sbostic .asciz "@(#)Ovfork.s 8.1 (Berkeley) 06/04/93" 1341012Swilliam#endif /* SYSLIBC_SCCS and not lint */ 1441012Swilliam 1541012Swilliam#include "SYS.h" 1641012Swilliam 1741012Swilliam/* 1841012Swilliam * pid = vfork(); 1941012Swilliam * 2041012Swilliam * %edx == 0 in parent process, %edx == 1 in child process. 2141012Swilliam * %eax == pid of child in parent, %eax == pid of parent in child. 2241012Swilliam * 2341012Swilliam */ 2441012Swilliam .set vfork,66 2541012Swilliam.globl _vfork 2641012Swilliam 2741012Swilliam_vfork: 2841012Swilliam popl %ecx /* my rta into ecx */ 2941012Swilliam movl $vfork, %eax 3041012Swilliam LCALL(7,0) 3141012Swilliam jb verror 3241012Swilliamvforkok: 3341012Swilliam cmpl $0,%edx /* child process? */ 3441012Swilliam jne child /* yes */ 3541012Swilliam jmp parent 3641012Swilliam.globl _errno 3741012Swilliamverror: 3841012Swilliam movl %eax,_errno 3941012Swilliam movl $-1,%eax 4041012Swilliam jmp %ecx 4141012Swilliamchild: 4241012Swilliam movl $0,%eax 4341012Swilliamparent: 4441012Swilliam jmp %ecx 45