152722Sbostic/*- 2*61146Sbostic * Copyright (c) 1991, 1993 3*61146Sbostic * The Regents of the University of California. All rights reserved. 452722Sbostic * 552722Sbostic * This code is derived from software contributed to Berkeley by 652722Sbostic * Ralph Campbell. 752722Sbostic * 852722Sbostic * %sccs.include.redist.c% 952722Sbostic */ 1052722Sbostic 1152722Sbostic#include "SYS.h" 1252722Sbostic 1352722Sbostic#if defined(LIBC_SCCS) && !defined(lint) 14*61146Sbostic ASMSTR("@(#)Ovfork.s 8.1 (Berkeley) 06/04/93") 1552722Sbostic#endif /* LIBC_SCCS and not lint */ 1652722Sbostic 1752722Sbostic/* 1852722Sbostic * pid = vfork(); 1952722Sbostic * 2052722Sbostic * v1 == 0 in parent process, v1 == 1 in child process. 2152722Sbostic * v0 == pid of child in parent, v0 == pid of parent in child. 2252722Sbostic */ 2352722Sbostic 2452722SbosticLEAF(vfork) 2552722Sbostic li v0, SYS_vfork # system call number for vfork 2652722Sbostic syscall 2752722Sbostic beq a3, zero, 1f # jump if no errors 2852722Sbostic j _cerror 2952722Sbostic1: 3052722Sbostic beq v1, zero, 2f # parent process ? 3152722Sbostic move v0, zero # return zero in child 3252722Sbostic2: 3352722Sbostic j ra 3452722SbosticEND(vfork) 35