P_CANSEE(9)

πŸ’– P_CANSEE(9) πŸ’–

okay so bestie, welcome to the P_CANSEE page from the Kernel Developer's Manual β€” yes it's a section 9 one, that's the kernel-dev girlies section, iykyk 🧚


✨ NAME ✨

p_cansee β€” figure out if a process is even visible πŸ‘€


🌸 SYNOPSIS 🌸

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

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

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, this function is your lil vibe check ✨ β€” you use it to determine whether a given process p is visible to the thread td. and when we say "visibility" here, read it as "awareness of existence" β€” like, does td even know p is out here living its best life? πŸ’…

The way it's implemented? It's riding on cr_cansee(9), no cap. Which means the dependencies on sysctl(8) variables that are documented over in the cr_cansee(9) manual page apply here too, fr fr. Go read that one, bestie, it's the lore 🫢


πŸ‘‘ RETURN VALUES πŸ‘‘

p_cansee() returns 0 if the process denoted by p is visible by thread td β€” slay πŸ’– β€” or a non-zero error return value otherwise. that's the whole mood.


πŸ’€ ERRORS πŸ’€

  • [ESRCH] β€” Process p is not visible to thread td, as determined by cr_cansee(9). it's giving invisible. πŸ™ˆ
  • [ESRCH] β€” Thread td has been jailed, and process p does not belong to the same jail as td. different jail, different world, no crossover 🚫
  • [ESRCH] β€” The MAC subsystem denied visibility. the MAC subsystem said no and honestly? it ate. 😭

πŸ”₯ SEE ALSO πŸ”₯

jail(2), sysctl(8), cr_cansee(9), mac(9), p_candebug(9), prison_check(9)


and that's the page, bestie!! this lil baddie came to you from Debian, dated November 19, 2006 β€” vintage icon behavior honestly, 2006 was out here being a main character before any of us. periodt πŸ’…βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ«Ά

πŸ“¦ where this page comes from