PR_GET_NO_NEW_PRIVS(2const)
π PR_GET_NO_NEW_PRIVS(2const) π
okay bestie, welcome to the PR_GET_NO_NEW_PRIVS page from the <linux/prctl.h> const-adjacent universe β this is a 2const page, so it's one of those little focused blorbos that lives alongside its sibling prctl(2) pages π«Ά
β¨ NAME β¨
PR_GET_NO_NEW_PRIVS β get the calling thread's no_new_privs attribute
no cap, that's literally it. you asking, kernel answering, no drama πΈ
π LIBRARY π
Standard C library (libc, -lc)
yep, plain ol' libc, nothing exotic, we love that for us π
π SYNOPSIS π
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_GET_NO_NEW_PRIVS, 0L, 0L, 0L, 0L);
not me passing four 0Ls like a little ritual π―οΈ they're all just zero, bestie, they're placeholders. prctl() has a fixed five-argument shape and this operation only cares about arg number one, so the rest are filler β¨
π¦ DESCRIPTION π¦
So like. This one returns the value of the no_new_privs attribute for the calling thread. That's it. That's the whole plot π
And the value it hands back is a boolean, so let's vibe check the two possible readings:
0β this means the regularexecve(2)behavior. everything normal, no extra restrictions riding along.1β this meansexecve(2)will operate in the privilege-restricting mode described over inPR_SET_NO_NEW_PRIVS(2const).
like, 1 is the "we locked it down" reading and 0 is the "we did not" reading. simple. iconic. periodt π
hot tip: if you want the full lore on what that privilege-restricting mode actually does and how to turn it ON, go read PR_SET_NO_NEW_PRIVS(2const) β this page is just the getter, it's the reader, not the writer β¨
π RETURN VALUE π
On success, PR_GET_NO_NEW_PRIVS returns the boolean value described above (so, 0 or 1, you know the drill).
On error, -1 is returned, and errno is set to indicate the error. classic. π
π FILES π
/proc/pid/statusβ since Linux 4.10, the value of a thread'sno_new_privsattribute can be viewed via theNoNewPrivsfield in this file.
ngl, peeking at NoNewPrivs in /proc/pid/status is the low-key way to check on a running thing without calling anything. absolutely obsessed with a file-based side quest π
β STANDARDS β
Linux.
just Linux. she's Linux-only and she knows it π
πΈ HISTORY πΈ
Linux 3.5.
so she's been around since 3.5, an elder statesman of a tiny getter, respect π«Ά
π₯ SEE ALSO π₯
β οΈ real talk though: this page documents a getter. The0vs1meaning only fully clicks once you've readPR_SET_NO_NEW_PRIVS(2const), so don't skip your homework, bestie π€
and that's the whole page, mwah π this was Linux man-pages version 6.20, dated 2026-02-08 β tysm for reading, go forth and get your no_new_privs 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 2012-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