PR_CAPBSET_READ(2const)
โจ PR_CAPBSET_READ(2const) โจ
okay bestie, pull up a chair (or like, a terminal tab) because we're talking about PR_CAPBSET_READ, a <pink>prctl(2)</pink> operation that lives in the <hotpink>2const</hotpink> pages (that (2const) is just the man-pages way of saying "this is one of the prctl constants, it's not its own syscall, don't come for me"). It's giving very niche, very powerful, very ๐
"I know what a capability bounding set is" energy. Let's go. ๐ฆ
๐ธ NAME ๐ธ
PR_CAPBSET_READ โ read the calling thread's capability bounding set. like, literally just peek at it. no touching. reading only. ๐
๐ LIBRARY ๐
Standard C library (libc, -lc). the classic. the moment. nothing sketchy, nothing exotic. ๐
โจ SYNOPSIS โจ
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_CAPBSET_READ, long cap);
yes, you call prctl() โ the one function, the icon โ and you hand it PR_CAPBSET_READ plus a long cap and it's gonna tell you things. ๐ฎ
๐ DESCRIPTION ๐
so here's the tea. PR_CAPBSET_READ returns 1 if the capability you named in cap is in the calling thread's capability bounding set, or 0 if it is not. that's it. that's the whole plot. boolean moment. true or false. ate. โ
โ
the capability constants you'd pass as cap are defined in <linux/capability.h> โ that's where you go to find the actual names, bestie, don't be out here guessing numbers. ๐
and now the part that actually matters, the lore: the capability bounding set dictates whether the process can receive the capability through a file's permitted capability set on a subsequent call to execve(2). so likeโฆ this set is the bouncer ๐ง and execve(2) is the party. if your capability isn't on the list, it is NOT getting in through that file's permitted capability set. no cap. ๐ซ๐๏ธ
๐ซถ RETURN VALUE ๐ซถ
- On success, this call returns the boolean value described above โ so
1or0, depending on whethercapis chillin' in the bounding set. - On error,
-1is returned, anderrnois set to indicate the error. ๐ญ (classic, honestly)
๐ ERRORS ๐
EINVALโcapdoes not specify a valid capability. you passed it something fake, babe. it's not a vibe check it can pass. ๐ฉ
๐ VERSIONS ๐
there's a higher-level interface layered on top of this operation, and it's provided in the libcap(3) library in the form of cap_get_bound(3). so if you want the fancy wrapper instead of rawdogging prctl(), that's your girl. โจ
โญ STANDARDS โญ
Linux. obviously. it's giving penguin. ๐ง
๐ HISTORY ๐
Linux 2.6.25. an elder. a legend. still serving. ๐
๐ SEE ALSO ๐
fr fr reminder: this page is read-only behavior โ the "READ" is right there in the name. if you wanna change the bounding set instead of just looking at it, go see PR_CAPBSET_DROP(2const). ๐
okay that's the whole thing, go forth and check your bounding set, you main character. ๐ฆ๐
this iconic little page came to you courtesy of Linux man-pages 6.20, dated 2026-02-08 โ mwah, no notes. ๐โจ
๐ฆ 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 2008-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