PFIND(9)
β¨ PFIND(9) β¨
okay so this is a page from the Kernel Developer's Manual (yes, the kernel one, we're in the big leagues bestie π
) and it's all about pfind and zpfind β the little duo that helps you locate a process by number. iykyk πΈ
π 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 *
zpfind(pid_t pid);
like, just include those two headers and you're literally ready to go β¨
π DESCRIPTION π
so pfind() takes a pid as its argument, and it 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 vibe check π«Ά
then there's zpfind(), which 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. zombies stay on the zombproc list, that's just how it is π§ββοΈ
and listen: both pfind() and zpfind() lock the proc structure that is returned, using PROC_LOCK(p). so the thing you get back comes pre-locked, no cap π₯
π RETURN VALUES π
pfind()andzpfind()return a pointer to aprocstructure on success π- and
NULLon failure π
that's it, that's the whole return story, periodt.
π SEE ALSO π
(the sibling page, go say hi β¨)
π AUTHORS π
This manual page was written by Evan Sarmiento <kaworu@sektor7.ath.cx>. iconic behavior fr fr π
quick reminder bestie: these return a locked proc β don't forget you're holding that lock, mkay? π
and that's the whole page!! π this Debian edition dropped on July 11, 2001 (a vintage baddie π
) β mwah, go read pgfind(9) next, ily π«Άπ
π¦ where this page comes from
- freebsd 14.5: base 14.5
- 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