CAP_SANDBOXED(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

hey bestie, welcome to CAP_SANDBOXED(3) β€” the Library Functions Manual page that makes sandbox checking feel effortless πŸ’…

✨ NAME ✨

cap_sandboxed β€” check if you're in a capability mode sandbox 🧚

πŸ“š LIBRARY πŸ“š

Standard C Library (libc, -lc) πŸ’–

πŸŽ€ SYNOPSIS πŸŽ€

#include <sys/capsicum.h>
#include <stdbool.h>

bool
cap_sandboxed(void);

🌸 DESCRIPTION 🌸

okay so cap_sandboxed() is literally the vibe check. It returns true if the process is in a capability mode sandbox, or false if it is not. πŸ¦‹

It's a more handy alternative to the cap_getmode(2) system call because it always succeeds β€” so there is no need for error checking, bestie. None. Zero. Not me worrying about return codes. πŸ™ˆ

If the support for capability mode is not compiled into the kernel, cap_sandboxed() will always return false. Periodt. ⭐

🫢 RETURN VALUES 🫢

Function cap_sandboxed() is always successful and will return either true or false. Slay. That's the whole section, no jump scare. πŸ’€

πŸ‘€ SEE ALSO πŸ‘€

πŸ•°οΈ HISTORY πŸ•°οΈ

The cap_sandboxed() function first appeared in FreeBSD 9.2. iconic behavior honestly πŸ‘‘

πŸ–‹οΈ AUTHORS πŸ–‹οΈ

This function was implemented and manual page was written by Pawel Jakub Dawidek <pawel@dawidek.net> under sponsorship of the FreeBSD Foundation. πŸ’œ


πŸ’– and that's the page, bestie πŸ’– β€” from the Debian edition, dated May 5, 2020. Now go be the main character of your own sandbox 🫢

πŸ“¦ where this page comes from