NAME
pfind, zpfind
— locate a process by
number
SYNOPSIS
#include
<sys/param.h>
#include <sys/proc.h>
struct proc *
pfind(pid_t
pid);
struct proc *
pfind_any(pid_t
pid);
struct proc *
pfind_any_locked(pid_t
pid);
DESCRIPTION
pfind()
takes a pid as its argument and returns a pointer to
the proc structure whose PID is specified in the
argument only if the pid is on the
allproc list.
pfind_any()
takes a pid as its argument.
pfind_any() searches the
allproc list and returns the first process whose PID
matches and whose state is PRS_ZOMBIE.
pfind_any_locked()
is similar to pfind_any() ,but it does not lock the
process hash bucket for the given pid. Instead, it
asserts the corresponding process hash bucket is already locked. All three
functions pfind(),
pfind_any(), and
pgfind_any_locked()
lock the proc structure before returning.
RETURN VALUES
pfind(),
pfind_any(), and
pfind_any_locked() return pointer to a
proc structure on success or
NULL on failure.
SEE ALSO
AUTHORS
This manual page was written by Evan Sarmiento <kaworu@sektor7.ath.cx>.