---
name: "p_cansee"
section: "9"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/p_cansee"
---

# p\_cansee(9)

determine visibility of a process

## NAME

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

## SYNOPSIS

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

*int*\

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

## DESCRIPTION

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

This function explicitly allows a thread to always see its own process, even with pending credentials changes( see [ucred(9)](/ucred/9.md)). Otherwise, it simply defers to [cr\_cansee(9)](/cr_cansee/9.md).

## RETURN VALUES

The **p\_cansee**() function returns 0 if the process denoted by *p* is visible by thread *td*, or ESRCH otherwise.

## ERRORS

- \[ESRCH\]

  Thread *td* is not part of process *p* and cannot see it as determined by [cr\_cansee(9)](/cr_cansee/9.md).

## SEE ALSO

[cr\_cansee(9)](/cr_cansee/9.md), [p\_candebug(9)](/p_candebug/9.md), [ucred(9)](/ucred/9.md)
