xref: /csrg-svn/lib/libc/vax/sys/cache.lib/getpid.c (revision 61226)
147918Sbostic /*-
2*61226Sbostic  * Copyright (c) 1983, 1993
3*61226Sbostic  *	The Regents of the University of California.  All rights reserved.
447915Sbostic  *
547918Sbostic  * %sccs.include.redist.c%
647915Sbostic  */
747915Sbostic 
847915Sbostic #if defined(LIBC_SCCS) && !defined(lint)
9*61226Sbostic 	.asciz "@(#)getpid.c	8.1 (Berkeley) 06/04/93"
1047915Sbostic #endif /* LIBC_SCCS and not lint */
1147915Sbostic 
1247915Sbostic #include "SYS.h"
1347915Sbostic 
1447915Sbostic 	.data
1547915Sbostic 	.globl	mypid, myppid
1647915Sbostic mypid:
1747915Sbostic 	.long	0
1847915Sbostic 	.text
1947915Sbostic 
2047915Sbostic ENTRY(getpid)
2147915Sbostic 	movl	mypid,r0	# check cache
2247915Sbostic 	beql	doit
2347915Sbostic 	ret
2447915Sbostic doit:
2547915Sbostic 	chmk	$SYS_getpid
2647915Sbostic 	jcs	err
2747915Sbostic 	movl	r0,mypid	# set cache
2847915Sbostic 	movl	r1,myppid	# set cache
2947915Sbostic 	ret			# pid = getpid();
3047915Sbostic err:
3147915Sbostic 	jmp cerror;
32