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βcapdoes 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
- Copyright 2015, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms