xref: /csrg-svn/lib/libc/vax/sys/cache.lib/fork.c (revision 47912)
1*47912Sbostic /*
2*47912Sbostic  * Copyright (c) 1983 The Regents of the University of California.
3*47912Sbostic  * All rights reserved.
4*47912Sbostic  *
5*47912Sbostic  * Redistribution and use in source and binary forms are permitted
6*47912Sbostic  * provided that the above copyright notice and this paragraph are
7*47912Sbostic  * duplicated in all such forms and that any documentation,
8*47912Sbostic  * advertising materials, and other materials related to such
9*47912Sbostic  * distribution and use acknowledge that the software was developed
10*47912Sbostic  * by the University of California, Berkeley.  The name of the
11*47912Sbostic  * University may not be used to endorse or promote products derived
12*47912Sbostic  * from this software without specific prior written permission.
13*47912Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14*47912Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15*47912Sbostic  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16*47912Sbostic  */
17*47912Sbostic 
18*47912Sbostic #if defined(LIBC_SCCS) && !defined(lint)
19*47912Sbostic 	.asciz "@(#)fork.c	5.1 (Berkeley) 04/12/91"
20*47912Sbostic #endif /* LIBC_SCCS and not lint */
21*47912Sbostic 
22*47912Sbostic #include "SYS.h"
23*47912Sbostic 
24*47912Sbostic 	.globl	mypid, myppid
25*47912Sbostic 
26*47912Sbostic SYSCALL(fork)
27*47912Sbostic 	jlbc	r1,1f	# parent, since r1 == 0 in parent, 1 in child
28*47912Sbostic 	movl	r0,myppid
29*47912Sbostic 	clrl	mypid
30*47912Sbostic 	clrl	r0
31*47912Sbostic 1:
32*47912Sbostic 	ret		# pid = fork()
33