P_CANSEE(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

🌸 NAME 🌸

okay so bestie, this is p_cansee β€” straight from the Kernel Developer's Manual, section P_CANSEE(9) β€” and it's literally the function that determines visibility of a process. Like, can this thread even see that process? πŸ‘€βœ¨ We're getting into it.

πŸŽ€ SYNOPSIS πŸŽ€

#include <sys/proc.h>

int
p_cansee(struct thread *td, struct proc *p);

πŸ¦‹ DESCRIPTION πŸ¦‹

So p_cansee() determines if a given process p is visible to the thread td. And the whole notion of β€œvisibility” here? Read it as β€œawareness of existence” β€” like, does td even know p exists? πŸ’–

This function explicitly allows a thread to always see its own process, even with pending credentials changes (see ucred(9) for that whole situation). Otherwise, it simply defers to cr_cansee(9). No cap. πŸ’…

🌈 RETURN VALUES 🌈

p_cansee() returns 0 if the process denoted by p is visible by thread td, or ESRCH otherwise. That's the whole vibe check, bestie. ✨

πŸ’€ ERRORS πŸ’€

  • [ESRCH] β€” Thread td is not part of process p and cannot see it as determined by cr_cansee(9). 😭

🫢 SEE ALSO 🫢


and that's the page, bestie πŸ’– this little icon is from Debian, dated August 18, 2023 β€” P_CANSEE(9) foreverrrr πŸŽ€βœ¨

πŸ“¦ where this page comes from