---
name: "PR_SET_NO_NEW_PRIVS"
section: "2const"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/PR_SET_NO_NEW_PRIVS"
---

# PR\_SET\_NO\_NEW\_PRIVS(2const)

set the calling thread's no\_new\_privs attribute

## NAME

PR\_SET\_NO\_NEW\_PRIVS - set the calling thread's no\_new\_privs attribute

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

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

**int prctl(PR\_SET\_NO\_NEW\_PRIVS, 1L, 0L, 0L, 0L);**

## DESCRIPTION

Set the calling thread's *no\_new\_privs* attribute. With *no\_new\_privs* set to 1, [**execve**(2)](/execve/2.md) promises not to grant privileges to do anything that could not have been done without the [**execve**(2)](/execve/2.md) call (for example, rendering the set-user-ID and set-group-ID mode bits, and file capabilities non-functional).

Once set, the *no\_new\_privs* attribute cannot be unset. The setting of this attribute is inherited by children created by [**fork**(2)](/fork/2.md) and [**clone**(2)](/clone/2.md), and preserved across [**execve**(2)](/execve/2.md).

## RETURN VALUE

On success, 0 is returned. On error, -1 is returned, and *errno* is set to indicate the error.

## ERRORS

- **EINVAL**

  The second argument is not equal to *1L*.

## FILES

- */proc/*pid*/status*

  Since Linux 4.10, the value of a thread's *no\_new\_privs* attribute can be viewed via the *NoNewPrivs* field in this file.

## STANDARDS

Linux.

## HISTORY

Linux 3.5.

## SEE ALSO

[**prctl**(2)](/prctl/2.md), [**PR\_GET\_NO\_NEW\_PRIVS**(2const)](/PR_GET_NO_NEW_PRIVS/2const.md), [**seccomp**(2)](/seccomp/2.md)

For more information, see the kernel source file *Documentation/userspace-api/no\_new\_privs.rst*.
