---
name: "prison_check"
section: "9"
platform: "linux"
package: "freebsd-manpages"
version: "6.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/prison_check"
---

# prison\_check(9)

determine if two credentials belong to the same jail

## NAME

**prison\_check** – determine if two credentials belong to the same jail

## SYNOPSIS

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

*int*\

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

## DESCRIPTION

This function can be used to determine if the two credentials *cred1* and *cred2* belong to the same jail.

## RETURN VALUES

The **prison\_check**() function returns ESRCH if *cred1* has been jailed, and *cred1* and *cred2* do not belong to the same jail. In all other cases, **prison\_check**() returns zero.

## SEE ALSO

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