FreeBSD/sys/kern/kern_proc.c
/*
 * Locate a process by number; return only "live" processes -- i.e., neither
 * zombies nor newly born but incompletely initialized processes.  By not
 * returning processes in the PRS_NEW state, we allow callers to avoid
 * testing for that condition to avoid dereferencing p_ucred, et al.
 */
Locate a process by number; return only "live" processes -- i.e., neither
zombies nor newly born but incompletely initialized processes.  By not
returning processes in the PRS_NEW state, we allow callers to avoid
testing for that condition to avoid dereferencing p_ucred, et al.
Locate a process by number ; return only " live " processes -- i . e . neither zombies nor newly born but incompletely initialized processes . By not returning processes in the PRS_NEW state we allow callers to avoid testing for that condition to avoid dereferencing p_ucred et al .
struct proc *
pfind(pid_t pid)
{
	struct proc *p;
	sx_slock(&allproc_lock);
	p = pfind_locked(pid);
	sx_sunlock(&allproc_lock);
	return (p);
}
struct proc * pfind ( pid_t pid ) { struct proc * p ; sx_slock ( & allproc_lock ) ; p = pfind_locked ( pid ) ; sx_sunlock ( & allproc_lock ) ; return ( p ) ; }
Locate a process by number; return only "live" processes -- i.e., neither
 zombies nor newly born but incompletely initialized processes.
Locate a process by number ; return only " live " processes -- i . e . neither zombies nor newly born but incompletely initialized processes .