---
name: "p_cansee"
section: "9freebsd"
platform: "linux"
package: "freebsd-manpages"
version: "12.2-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/p_cansee/9freebsd"
---

# p\_cansee(9freebsd)

determine visibility of a process

## NAME

**p\_cansee** – determine visibility of a process

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<sys/proc.h\>**

*int*\

**p\_cansee**(*struct thread \*td*, *struct proc \*p*);

## DESCRIPTION

This function can be used to determine if a given process *p* is visible to the thread *td*, where the notion of “visibility” may be read as “awareness of existence”.

The function is implemented using [cr\_cansee(9)](/cr_cansee/9.md), and the dependencies on [sysctl(8)](/sysctl/8.md) variables documented in the [cr\_cansee(9)](/cr_cansee/9.md) manual page apply.

## RETURN VALUES

The **p\_cansee**() function returns 0 if the process denoted by *p* is visible by thread *td*, or a non-zero error return value otherwise.

## ERRORS

- \[ESRCH\]

  Process *p* is not visible to thread *td* as determined by [cr\_cansee(9)](/cr_cansee/9.md).

- \[ESRCH\]

  Thread *td* has been jailed and process *p* does not belong to the same jail as *td*.

- \[ESRCH\]

  The MAC subsystem denied visibility.

## SEE ALSO

[jail(2)](/jail/2.md), [sysctl(8)](/sysctl/8.md), [cr\_cansee(9)](/cr_cansee/9.md), [mac(9)](/mac/9.md), [p\_candebug(9)](/p_candebug/9.md), [prison\_check(9)](/prison_check/9.md)
