1 /*-
2  * Copyright (c) 1983, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #if defined(LIBC_SCCS) && !defined(lint)
9 	.asciz "@(#)getppid.c	8.1 (Berkeley) 06/04/93"
10 #endif /* LIBC_SCCS and not lint */
11 
12 #include "SYS.h"
13 
14 	.data
15 	.globl	mypid, myppid
16 myppid:
17 	.long	0
18 	.text
19 
20 ENTRY(getpid)
21 	movl	myppid,r0	# check cache
22 	beql	doit
23 	ret
24 doit:
25 	chmk	$SYS_getpid
26 	jcs	err
27 	movl	r0,mypid	# cache pid
28 	movl	r1,r0
29 	movl	r0,myppid	# set cache
30 	ret			# ppid = getppid();
31 err:
32 	jmp cerror;
33