PR_GET_KEEPCAPS(2const)

πŸ’– PR_GET_KEEPCAPS πŸ’–

okay bestie, so this is a <pink>2const</pink> man page β€” it's not a whole function, it's one lil' constant you can yeet at prctl(2). And honestly? It's giving "quick check-in with the kernel" energy. ✨


🌸 NAME 🌸

PR_GET_KEEPCAPS β€” get the state of the "keep capabilities" flag πŸ‘‘

πŸŽ€ LIBRARY πŸŽ€

Standard C library (libc, -lc) 🫢

✨ SYNOPSIS ✨

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

int prctl(PR_GET_KEEPCAPS);

πŸ’… DESCRIPTION πŸ’…

So basically, this call returns the current state of the calling thread's "keep capabilities" flag. That's it. That's the whole vibe. πŸ¦‹

If you wanna know what this flag actually means β€” like, why anyone would keep capabilities around β€” go read capabilities(7), bestie, it explains the whole thing. This page is just the little getter. 😌

⭐ RETURN VALUE ⭐

On success, this call returns the boolean value described above (the state of the flag, slay). πŸ’–

On error, -1 is returned, and errno is set to indicate the error. so like, always check. it's giving "not me ignoring the return value" πŸ’€

πŸ‘‘ STANDARDS πŸ‘‘

Linux. lowkey iconic, highkey expected. 🐧

πŸ•°οΈ HISTORY πŸ•°οΈ

Linux 2.2.18. ancient. vintage. a true elder of the kernel. 🌈

🫢 SEE ALSO 🫢


fr fr, if you're setting this flag you're probably also reading PR_SET_KEEPCAPS(2const) β€” they're a matching set, iykyk πŸ’…

okay that's the whole page, no cap β€” but credit where it's due: this was written up in the Linux man-pages 6.20 collection, dated 2026-02-08. go off, man-pages maintainers. πŸŽ€βœ¨

πŸ“¦ 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