PR_CAP_AMBIENT_LOWER(2const)
π PR_CAP_AMBIENT_LOWER β lower the ambient capability set of the calling thread π
okay bestie, welcome to PR_CAP_AMBIENT_LOWER β a prctl(2) sub-operation, i.e. one of those 2const manual page girlies (yes, that's the manual section name, we're in the (2const) section, slay). This one is all about taking a capability OUT of your thread's ambient set. Let's get into it π
β¨ LIBRARY β¨
Standard C library β libc, -lc. The classic. Nothing fancy, she's just vibing in libc π¦
π SYNOPSIS π
okay so here's the whole shape of it, literally:
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_LOWER, long cap, 0L, 0L);
notice how the third arg is where cap goes and the last two are 0L, 0L β yes, you HAVE to pass those zeroes, they're not optional-optional, they're just chillin' there being 0L π
πΈ DESCRIPTION πΈ
So the entire plot: the capability you name in cap gets removed from the ambient capability set. That's it. That's the whole job. You point at a capability, and it's gone from ambient. Periodt π
π₯ RETURN VALUE π₯
- On success β you get
0back. Iconic. Main character energy β¨ - On error β you get
-1, anderrnois set to tell you what went wrong. Rude but informative π
π ERRORS π
EINVALβcapdoes not specify a valid capability. Like girl, that's not a real capability, try again π
π§ VERSIONS π§
lowkey this section is just a redirect β see PR_CAP_AMBIENT(2const). All the version lore lives over there π«Ά
π STANDARDS π
Linux. That's it, that's the standard. Linux only, no cap π§
β HISTORY β
Arrived in Linux 4.3. A lil vintage, a lil retro, still serving π
π SEE ALSO π
okay that's the whole page, you ate that π remember: cap in, capability out of the ambient set, check errno if you get -1, and don't forget those two 0Ls or the kernel will simply not hear you π
this page is from Linux man-pages 6.20, dated 2026-02-08, and it's the PR_CAP_AMBIENT_LOWER(2const) one β mwah, bye bestie πβ¨
π¦ 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