.\" Copyright 2012-2015, Michael Kerrisk .\" Copyright, the authors of the Linux man-pages project .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .TH PR_SET_NO_NEW_PRIVS 2const 2026-02-08 "Linux man-pages 6.19" .SH NAME PR_SET_NO_NEW_PRIVS \- set the calling thread's no_new_privs attribute .SH LIBRARY Standard C library .RI ( libc ,\~ \-lc ) .SH SYNOPSIS .nf .BR "#include " " /* Definition of " PR_* " constants */" .B #include .P .B int prctl(PR_SET_NO_NEW_PRIVS, 1L, 0L, 0L, 0L); .fi .SH DESCRIPTION Set the calling thread's .I no_new_privs attribute. With .I no_new_privs set to 1, .BR execve (2) promises not to grant privileges to do anything that could not have been done without the .BR execve (2) call (for example, rendering the set-user-ID and set-group-ID mode bits, and file capabilities non-functional). .P Once set, the .I no_new_privs attribute cannot be unset. The setting of this attribute is inherited by children created by .BR fork (2) and .BR clone (2), and preserved across .BR execve (2). .SH RETURN VALUE On success, 0 is returned. On error, \-1 is returned, and .I errno is set to indicate the error. .SH ERRORS .TP .B EINVAL The second argument is not equal to .IR 1L . .SH FILES .TP .IR /proc/ pid /status Since Linux 4.10, the value of a thread's .I no_new_privs attribute can be viewed via the .I NoNewPrivs field in this file. .SH STANDARDS Linux. .SH HISTORY Linux 3.5. .SH SEE ALSO .BR prctl (2), .BR PR_GET_NO_NEW_PRIVS (2const), .BR seccomp (2) .P For more information, see the kernel source file .IR Documentation/\:userspace\-api/\:no_new_privs.rst .