Manual Page Search Parameters

PFIND(9) Kernel Developer's Manual PFIND(9)

pfind, zpfindlocate a process by number

#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);

() 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.

() 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.

() 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 () lock the proc structure before returning.

pfind(), pfind_any(), and pfind_any_locked() return pointer to a proc structure on success or NULL on failure.

pgfind(9)

This manual page was written by Evan Sarmiento <kaworu@sektor7.ath.cx>.

December 3, 2024 release-26.07