TFIND(9)

πŸ“¦ in nixpkgs unstable

πŸ¦‹ TFIND(9) β€” Kernel Developer’s Manual, but make it bestie-core πŸ¦‹

okay so this is the tfind(9) page from the Kernel Developer’s Manual, and we’re about to make thread/process/process-group lookups make sense. no cap. πŸ’…


🌸 NAME 🌸

tfind, prfind, pgfind β€” find thread, process and process group by number, bestie. πŸŽ€


✨ SYNOPSIS ✨

#include <sys/types.h>
#include <sys/signal.h>
#include <sys/proc.h>

struct proc *
tfind(pid_t tid);

struct process *
prfind(pid_t pid);

struct pgrp *
pgfind(pid_t pgid);

πŸ’– DESCRIPTION πŸ’–

okay so these three functions are your little lookup besties: tfind(), prfind(), and pgfind() retrieve thread, process and process group structures from thread, process and process group IDs, respectively. 🫢

so like: tfind() is giving thread-structure-by-tid, prfind() is giving process-structure-by-pid, and pgfind() is giving process-group-structure-by-pgid. iconic mapping, fr fr. 🌈

and if the requested ID can’t be found? these functions return NULL. that’s the vibe check result: not found, bestie. πŸ’€


πŸ”₯ CODE REFERENCES πŸ”₯

those functions are implemented in the file sys/kern/kern_proc.c. go peek if you want the lore. πŸ‘‘


mwah πŸ’‹ β€” source/version: Debian; date: June 13, 2025. bye bestie 🫢✨

πŸ“¦ where this page comes from