p_cansee(9) determine visibility of a process

SYNOPSIS

In sys/param.h In sys/proc.h Ft int Fn p_cansee struct thread *td struct proc *p

DESCRIPTION

This function can be used to determine if a given process Fa p is visible to the thread Fa td , where the notion of ``visibility'' may be read as ``awareness of existence''

The function is implemented using cr_cansee9, and the dependencies on sysctl(8) variables documented in the cr_cansee9 manual page apply.

RETURN VALUES

The Fn p_cansee function returns 0 if the process denoted by Fa p is visible by thread Fa td , or a non-zero error return value otherwise.

ERRORS

Bq Er ESRCH
Process Fa p is not visible to thread Fa td as determined by cr_cansee9.
Bq Er ESRCH
Thread Fa td has been jailed and process Fa p does not belong to the same jail as Fa td .
Bq Er ESRCH
The MAC subsystem denied visibility.