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 0 back. Iconic. Main character energy ✨
  • On error β€” you get -1, and errno is set to tell you what went wrong. Rude but informative 😭

πŸ’€ ERRORS πŸ’€

  • EINVAL β€” cap does 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms