---
name: "cr_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/cr_cansee"
---

# cr\_cansee(9)

determine visibility of objects given their user credentials

## NAME

**cr\_cansee** – determine visibility of objects given their user credentials

## SYNOPSIS

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

*int*\

**cr\_cansee**(*struct ucred \*u1*, *struct ucred \*u2*);

## DESCRIPTION

This function determines if a subject with credential *u1* can see a subject or object associated to credential *u2*.

Specific types of subjects may need to submit to additional or different restrictions. As an example, for processes, see [p\_cansee(9)](/p_cansee/9.md), which calls this function.

The implementation relies on [cr\_bsd\_visible(9)](/cr_bsd_visible/9.md) and consequently the [sysctl(8)](/sysctl/8.md) variables referenced in its manual page influence the result.

## RETURN VALUES

This function returns zero if the subject with credential *u1* can “see” the subject or object with credential *u2*, or ESRCH otherwise.

## ERRORS

- \[ESRCH\]

  The subject with credential *u1* has been jailed and the subject or object with credential *u2* does not belong to the same jail or one of its sub-jails, as determined by [prison\_check(9)](/prison_check/9.md).

- \[ESRCH\]

  The MAC subsystem denied visibility.

- \[ESRCH\]

  [cr\_bsd\_visible(9)](/cr_bsd_visible/9.md) denied visibility according to the BSD security policies in force.

## SEE ALSO

[cr\_bsd\_visible(9)](/cr_bsd_visible/9.md), [mac(9)](/mac/9.md), [p\_cansee(9)](/p_cansee/9.md), [prison\_check(9)](/prison_check/9.md)
