---
name: "PR_SET_SECUREBITS"
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_SECUREBITS"
---

# PR\_SET\_SECUREBITS(2const)

set the "securebits" flags of the calling thread

## NAME

PR\_SET\_SECUREBITS - set the "securebits" flags of the calling thread

## LIBRARY

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

## SYNOPSIS

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

**int prctl(PR\_SET\_SECUREBITS, unsigned long** *flags***);**

## DESCRIPTION

Set the "securebits" flags of the calling thread to the value supplied in *flags*. See [**capabilities**(7)](/capabilities/7.md).

## RETURN VALUE

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

## ERRORS

- **EINVAL**

  *flags* is not a valid value.

- **EPERM**

  The caller does not have the **CAP\_SETPCAP** capability, or tried to unset a "locked" flag, or tried to set a flag whose corresponding locked flag was set (see [**capabilities**(7)](/capabilities/7.md)).

## STANDARDS

Linux.

## HISTORY

Linux 2.6.26.

## SEE ALSO

[**prctl**(2)](/prctl/2.md), [**PR\_GET\_SECUREBITS**(2const)](/PR_GET_SECUREBITS/2const.md), [**capabilities**(7)](/capabilities/7.md)
