From bae3a80b1663a5466d04ff19aa940de2d130304f Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Sat, 24 Mar 2001 04:00:01 +0000 Subject: [PATCH] Just use the proc lock to protect read accesses to p_pptr rather than the more expensive proctree lock. --- sys/kern/kern_prot.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 9d92ff70493..616286255ba 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -79,9 +79,9 @@ getpid(p, uap) p->p_retval[0] = p->p_pid; #if defined(COMPAT_43) || defined(COMPAT_SUNOS) - PROCTREE_LOCK(PT_SHARED); + PROC_LOCK(p); p->p_retval[1] = p->p_pptr->p_pid; - PROCTREE_LOCK(PT_RELEASE); + PROC_UNLOCK(p); #endif return (0); } @@ -102,9 +102,9 @@ getppid(p, uap) struct getppid_args *uap; { - PROCTREE_LOCK(PT_SHARED); + PROC_LOCK(p); p->p_retval[0] = p->p_pptr->p_pid; - PROCTREE_LOCK(PT_RELEASE); + PROC_UNLOCK(p); return (0); }