PFIND(9)

πŸ’– PFIND(9) β€” Kernel Developer's Manual πŸ’–

okay bestie, welcome to PFIND(9) ✨ this is the kernel dev manual page for two little functions that go find a process for you, and honestly? they ate. let's get into it 🫢


🌸 NAME 🌸

pfind, zpfind β€” locate a process by number πŸ”


✨ SYNOPSIS ✨

like, here's the whole vibe, copy-paste it exactly bestie:

#include <sys/param.h>
#include <sys/proc.h>

struct proc *
pfind(pid_t pid);

struct proc *
zpfind(pid_t pid);

πŸ’… DESCRIPTION πŸ’…

okay so. pfind() takes a pid as its argument and returns a pointer to the proc structure whose PID is specified in the argument β€” but ONLY if that pid is on the allproc list. no allproc, no pointer, that's the rule πŸŽ€

and then zpfind() also takes a pid as its argument. if zpfind() finds a process whose PID is equal to that of the argument and it's a zombie process β€” meaning it must reside on the zombproc list 🧟 β€” then zpfind() returns a pointer to that proc structure. it's giving "found the undead one" πŸ’€βœ¨

both pfind() and zpfind() lock the proc structure that is returned, using PROC_LOCK(p). πŸ”’ no cap, that lock is real, respect it.

🌈 RETURN VALUES 🌈

pfind() and zpfind() return a pointer to a proc structure on success πŸ’– and a NULL on failure 😭 that's it, that's the whole deal.


πŸ¦‹ SEE ALSO πŸ¦‹


πŸ‘‘ AUTHORS πŸ‘‘

this manual page was written by Evan Sarmiento <kaworu@sektor7.ath.cx> 🌟 iconic behavior honestly.


and that's a wrap, bestie πŸŽ€ this was the Debian flavored version, dated July 11, 2001, filed under PFIND(9) β€” mwah, go find some processes, you got this πŸ’…πŸ’œ

πŸ“¦ where this page comes from