---
name: "cap_sandboxed"
section: "3"
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/cap_sandboxed"
---

# cap\_sandboxed(3)

Check if in a capability mode sandbox

## NAME

**cap\_sandboxed** – Check if in a capability mode sandbox

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

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

**#include \<stdbool.h\>**

*bool*\

**cap\_sandboxed**(*void*);

## DESCRIPTION

**cap\_sandboxed**() returns *true* if the process is in a capability mode sandbox or *false* if it is not. This function is a more handy alternative to the [cap\_getmode(2)](/cap_getmode/2.md) system call as it always succeeds, so there is no need for error checking. If the support for capability mode is not compiled into the kernel, **cap\_sandboxed**() will always return *false*.

## RETURN VALUES

Function **cap\_sandboxed**() is always successful and will return either *true* or *false*.

## SEE ALSO

[cap\_enter(2)](/cap_enter/2.md), [capsicum(4)](/capsicum/4.md)

## HISTORY

The **cap\_sandboxed**() function first appeared in FreeBSD 9.2.

## AUTHORS

This function was implemented and manual page was written by Pawel Jakub Dawidek ⟨*pawel@dawidek.net*⟩ under sponsorship of the FreeBSD Foundation.
