diff options
| author | Matthew Dillon <dillon@FreeBSD.org> | 2001-10-26 20:48:04 +0000 |
|---|---|---|
| committer | Matthew Dillon <dillon@FreeBSD.org> | 2001-10-26 20:48:04 +0000 |
| commit | d23f5958bcd82d543098031ef42839d2d8a1088e (patch) | |
| tree | 1a0359519be06ef4a108396a833c5cf3b6427607 /sys/kern/kern_prot.c | |
| parent | 8d5c8e9f048bdc1963d6556ba231484e6b56de7a (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_prot.c')
| -rw-r--r-- | sys/kern/kern_prot.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 553b27810458..894efacf51db 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -86,15 +86,16 @@ getpid(td, uap) struct getpid_args *uap; { struct proc *p = td->td_proc; + int s; - mtx_lock(&Giant); + s = mtx_lock_giant(kern_giant_proc); td->td_retval[0] = p->p_pid; #if defined(COMPAT_43) || defined(COMPAT_SUNOS) PROC_LOCK(p); td->td_retval[1] = p->p_pptr->p_pid; PROC_UNLOCK(p); #endif - mtx_unlock(&Giant); + mtx_unlock_giant(s); return (0); } @@ -117,12 +118,13 @@ getppid(td, uap) struct getppid_args *uap; { struct proc *p = td->td_proc; + int s; - mtx_lock(&Giant); + s = mtx_lock_giant(kern_giant_proc); PROC_LOCK(p); td->td_retval[0] = p->p_pptr->p_pid; PROC_UNLOCK(p); - mtx_unlock(&Giant); + mtx_unlock_giant(s); return (0); } @@ -170,8 +172,9 @@ getpgid(td, uap) struct proc *p = td->td_proc; struct proc *pt; int error = 0; + int s; - mtx_lock(&Giant); + s = mtx_lock_giant(kern_giant_proc); if (uap->pid == 0) td->td_retval[0] = p->p_pgrp->pg_id; else if ((pt = pfind(uap->pid)) == NULL) @@ -182,7 +185,7 @@ getpgid(td, uap) td->td_retval[0] = pt->p_pgrp->pg_id; PROC_UNLOCK(pt); } - mtx_unlock(&Giant); + mtx_unlock_giant(s); return (error); } |
