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

# securelevel\_gt(9freebsd)

test active securelevel

Part of [securelevel\_ge(9freebsd)](/securelevel_ge/9freebsd.md).

## NAME

**securelevel\_gt**, **securelevel\_ge** – test active securelevel

## SYNOPSIS

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

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

*int*\

**securelevel\_gt**(*struct ucred \*cr*, *int level*);

*int*\

**securelevel\_ge**(*struct ucred \*cr*, *int level*);

## DESCRIPTION

These functions test the active security level against the given *level*. If the calling credential *cr* was imprisoned by the [jail(2)](/jail/2.md) system call, and has a different security level set than the host environment, the security level with the highest value is used.

The **securelevel\_gt**() function will evaluate whether or not the active security level is greater than the supplied *level*.

The **securelevel\_ge**() function will evaluate whether or not the active security level is greater than or equal to the supplied *level*.

## RETURN VALUES

These functions return EPERM if condition evaluated to true, and 0 otherwise.

## SEE ALSO

[securelevel(7)](/securelevel/7.md)
