PR_CAP_AMBIENT_IS_SET(2const)

πŸ’– PR_CAP_AMBIENT_IS_SET(2const) πŸ’–

okay bestie, so you found a 2const page β€” those are the lil' constant-flavored corner pages of the Linux man-pages project, and this one is all about peeking at your own ambient capabilities. no cap, it's a whole vibe check for privileges. πŸ¦‹


✨ NAME ✨

PR_CAP_AMBIENT_IS_SET β€” read the ambient capability set of the calling thread πŸ‘‘

like, of the calling thread specifically. it's giving main character energy but only for the thread that actually made the call. πŸ’…


πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc) 🌸


πŸŽ€ SYNOPSIS πŸŽ€

#include <linux/prctl.h>  /* Definition of PR_* constants */
#include <sys/prctl.h>

int prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_IS_SET, long cap, 0L, 0L);

so yeah, you're calling the big prctl(2) and handing it PR_CAP_AMBIENT as the operation, with PR_CAP_AMBIENT_IS_SET as the sub-operation. the 0L, 0L at the end are just vibing, they're unused here. ✨


πŸ’œ DESCRIPTION πŸ’œ

This call returns 1 if the capability in cap is in the ambient capability set, and 0 if it is not. that's it. that's the whole thing. binary answer, no small talk. πŸ’€

ngl this is the most lowkey useful lil' query ever β€” "is this specific capability in my ambient set, yes or no?" and boom, you get a boolean back. periodt. 🫢


πŸ“ RETURN VALUE πŸ“

On success, this call returns the boolean value described above (so like, 1 or 0, no in-between bestie). 😭

On error, -1 is returned, and errno is set to indicate the error. so always always always check your errno, i'm begging 🧚


⚠️ ERRORS ⚠️

  • EINVAL β€” cap does not specify a valid capability. so if you handed it a capability that doesn't exist, this is the ✨gentle✨ way it tells you to try again. πŸ™ˆ

🌈 VERSIONS 🌈

See PR_CAP_AMBIENT(2const). πŸ¦‹ (go read the parent page, it has the whole ambient-capabilities lore, iykyk)


⭐ STANDARDS ⭐

Linux. just Linux. that's the standard. πŸ‘‘


πŸ”₯ HISTORY πŸ”₯

Linux 4.3. it's been here since 4.3, serving bools and minding its business. πŸ’–


πŸ‘€ SEE ALSO πŸ‘€


real talk: this call only ever reads. it does not change your ambient set β€” it just tells you what's in there. no cap, purely a read-only vibe check ✨

and that's the tea, bestie β€” Linux man-pages version 6.20, dated 2026-02-08. slay, go forth and check your ambient capabilities responsibly πŸ’…πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: Linux-man-pages-copyleft
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms