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

# prison\_check(9)

determine if subjects may see entities according to jail restrictions

## NAME

**prison\_check** – determine if subjects may see entities according to jail restrictions

## SYNOPSIS

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

*int*\

**prison\_check**(*struct ucred \*cred1*, *struct ucred \*cred2*);

## DESCRIPTION

This function determines if a subject with credentials *cred1* is denied access to subjects or objects with credentials *cred2* according to the policy that a subject can see subjects or objects in its own jail or any sub-jail of it.

## RETURN VALUES

The **prison\_check**() function returns ESRCH if *cred2* is not in the same jail or a sub-jail of that of *cred1*. In all other cases, **prison\_check**() returns zero.

## SEE ALSO

[jail(2)](/jail/2.md)
