xref: /original-bsd/lib/libc/mips/sys/Ovfork.s (revision 34cc5a85)
1/*-
2 * Copyright (c) 1991, 1993
3 *	The Regents of the University of California.  All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Ralph Campbell.
7 *
8 * %sccs.include.redist.c%
9 */
10
11#include "SYS.h"
12
13#if defined(LIBC_SCCS) && !defined(lint)
14	ASMSTR("@(#)Ovfork.s	8.1 (Berkeley) 06/04/93")
15#endif /* LIBC_SCCS and not lint */
16
17/*
18 * pid = vfork();
19 *
20 * v1 == 0 in parent process, v1 == 1 in child process.
21 * v0 == pid of child in parent, v0 == pid of parent in child.
22 */
23
24LEAF(vfork)
25	li	v0, SYS_vfork		# system call number for vfork
26	syscall
27	beq	a3, zero, 1f		# jump if no errors
28	j	_cerror
291:
30	beq	v1, zero, 2f		# parent process ?
31	move	v0, zero		# return zero in child
322:
33	j	ra
34END(vfork)
35