1*47918Sbostic /*- 247915Sbostic * Copyright (c) 1983 The Regents of the University of California. 347915Sbostic * All rights reserved. 447915Sbostic * 5*47918Sbostic * %sccs.include.redist.c% 647915Sbostic */ 747915Sbostic 847915Sbostic #if defined(LIBC_SCCS) && !defined(lint) 9*47918Sbostic .asciz "@(#)getpid.c 5.2 (Berkeley) 04/12/91" 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