xref: /csrg-svn/lib/libc/mips/sys/fork.s (revision 61148)
152726Sbostic/*-
2*61148Sbostic * Copyright (c) 1991, 1993
3*61148Sbostic *	The Regents of the University of California.  All rights reserved.
452726Sbostic *
552726Sbostic * This code is derived from software contributed to Berkeley by
652726Sbostic * Ralph Campbell.
752726Sbostic *
852726Sbostic * %sccs.include.redist.c%
952726Sbostic */
1052726Sbostic
1152726Sbostic#include "SYS.h"
1252726Sbostic
1352726Sbostic#if defined(LIBC_SCCS) && !defined(lint)
14*61148Sbostic	ASMSTR("@(#)fork.s	8.1 (Berkeley) 06/04/93")
1552726Sbostic#endif /* LIBC_SCCS and not lint */
1652726Sbostic
1752726SbosticLEAF(fork)
1852726Sbostic	li	v0, SYS_fork	# pid = fork()
1952726Sbostic	syscall
2052726Sbostic	bne	a3, zero, 2f
2152726Sbostic	beq	v1, zero, 1f	# v1 == 0 in parent, 1 in child
2252726Sbostic	move	v0, zero
2352726Sbostic1:
2452726Sbostic	j	ra
2552726Sbostic2:
2652726Sbostic	j	_cerror
2752726SbosticEND(fork)
28