---
name: "PR_GET_SPECULATION_CTRL"
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_GET_SPECULATION_CTRL"
---

# PR\_GET\_SPECULATION\_CTRL(2const)

get the state of a speculation misfeature for the calling thread

## NAME

PR\_GET\_SPECULATION\_CTRL - get the state of a speculation misfeature for 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\_GET\_SPECULATION\_CTRL, long** *misfeature***, 0L, 0L, 0L);**

## DESCRIPTION

Return the state of the speculation misfeature specified in *misfeature*.

Currently, *misfeature* must be one of:

- **PR\_SPEC\_STORE\_BYPASS**

  Get the state of the speculative store bypass misfeature.

- **PR\_SPEC\_INDIRECT\_BRANCH** (since Linux 4.20)

  Get the state of the indirect branch speculation misfeature.

The return value uses bits 0-4 with the following meaning:

- **PR\_SPEC\_PRCTL**

  Mitigation can be controlled per thread by [**PR\_SET\_SPECULATION\_CTRL**(2const)](/PR_SET_SPECULATION_CTRL/2const.md).

- **PR\_SPEC\_ENABLE**

  The speculation feature is enabled, mitigation is disabled.

- **PR\_SPEC\_DISABLE**

  The speculation feature is disabled, mitigation is enabled.

- **PR\_SPEC\_FORCE\_DISABLE**

  Same as **PR\_SPEC\_DISABLE** but cannot be undone.

- **PR\_SPEC\_DISABLE\_NOEXEC** (since Linux 5.1)

  Same as **PR\_SPEC\_DISABLE**, but the state will be cleared on [**execve**(2)](/execve/2.md).

If all bits are 0, then the CPU is not affected by the speculation misfeature.

If **PR\_SPEC\_PRCTL** is set, then per-thread control of the mitigation is available. If not set, [**PR\_SET\_SPECULATION\_CTRL**(2const)](/PR_SET_SPECULATION_CTRL/2const.md) for the speculation misfeature will fail.

## RETURN VALUE

On success, **PR\_GET\_SPECULATION\_CTRL** returns the nonnegative value described above. On error, -1 is returned, and *errno* is set to indicate the error.

## ERRORS

- **ENODEV**

  The kernel or CPU does not support the requested speculation *misfeature*.

## STANDARDS

Linux.

## HISTORY

Linux 4.17.

## SEE ALSO

[**prctl**(2)](/prctl/2.md), [**PR\_SET\_SPECULATION\_CTRL**(2const)](/PR_SET_SPECULATION_CTRL/2const.md)
