147918Sbostic /*- 2*61226Sbostic * Copyright (c) 1983, 1993 3*61226Sbostic * The Regents of the University of California. All rights reserved. 447916Sbostic * 547918Sbostic * %sccs.include.redist.c% 647916Sbostic */ 747916Sbostic 847916Sbostic #if defined(LIBC_SCCS) && !defined(lint) 9*61226Sbostic .asciz "@(#)getppid.c 8.1 (Berkeley) 06/04/93" 1047916Sbostic #endif /* LIBC_SCCS and not lint */ 1147916Sbostic 1247916Sbostic #include "SYS.h" 1347916Sbostic 1447916Sbostic .data 1547916Sbostic .globl mypid, myppid 1647916Sbostic myppid: 1747916Sbostic .long 0 1847916Sbostic .text 1947916Sbostic 2047916Sbostic ENTRY(getpid) 2147916Sbostic movl myppid,r0 # check cache 2247916Sbostic beql doit 2347916Sbostic ret 2447916Sbostic doit: 2547916Sbostic chmk $SYS_getpid 2647916Sbostic jcs err 2747916Sbostic movl r0,mypid # cache pid 2847916Sbostic movl r1,r0 2947916Sbostic movl r0,myppid # set cache 3047916Sbostic ret # ppid = getppid(); 3147916Sbostic err: 3247916Sbostic jmp cerror; 33