PFIND(9)
π PFIND(9) β locate a process by number π
okay so this is from the Kernel Developer's Manual, section 9, and we're doing a little process-hunting expedition, bestie. no cap. π«Ά
π NAME π
pfind, pfind_any, pfind_any_locked β 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 π¦
okay so pfind() is the main character here: it walks the list of processes in the system, looking for the one with a process ID of pid. if that process exists, and is not in the zombie state, you get a pointer to the process structure back. slay. π
pfind_any() takes a pid as its argument too. it searches the allproc list and returns the first process with a matching PID, and its state may be PRS_ZOMBIE β so yes, zombies are allowed here, no cap. π§ββοΈ
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. iykyk. π
all three functions β pfind(), pfind_any(), and pfind_any_locked() β lock the proc structure before returning. periodt. π
πΈ RETURN VALUES πΈ
pfind(), pfind_any(), and pfind_any_locked() return pointer to a proc structure on success or NULL on failure. that's the whole vibe check. β¨
π¦ SEE ALSO π¦
π AUTHORS π
this manual page was written by Evan Sarmiento <kaworu@sektor7.ath.cx>. iconic. π«Ά
Debian Β· November 3, 2025 Β· PFIND(9) β mwah π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 2001 Evan Sarmiento
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms