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