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

# prctl(2)

operations on a process or thread

## NAME

prctl - operations on a process or thread

## LIBRARY

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

## SYNOPSIS

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

**int prctl(int** *op***, ...);**

## DESCRIPTION

**prctl**() manipulates various aspects of the behavior of the calling thread or process.

**prctl**() is called with a first argument describing what to do, and further arguments with a significance depending on the first one. The first argument can be:

- **PR\_CAP\_AMBIENT** **PR\_CAPBSET\_READ** **PR\_CAPBSET\_DROP** **PR\_SET\_CHILD\_SUBREAPER** **PR\_GET\_CHILD\_SUBREAPER** **PR\_SET\_DUMPABLE** **PR\_GET\_DUMPABLE** **PR\_SET\_ENDIAN** **PR\_GET\_ENDIAN** **PR\_SET\_FP\_MODE** **PR\_GET\_FP\_MODE** **PR\_SET\_FPEMU** **PR\_GET\_FPEMU** **PR\_SET\_FPEXC** **PR\_GET\_FPEXC** **PR\_SET\_IO\_FLUSHER** **PR\_GET\_IO\_FLUSHER** **PR\_SET\_KEEPCAPS** **PR\_GET\_KEEPCAPS** **PR\_MCE\_KILL** **PR\_MCE\_KILL\_GET** **PR\_SET\_MM** **PR\_SET\_VMA** **PR\_MPX\_ENABLE\_MANAGEMENT** **PR\_MPX\_DISABLE\_MANAGEMENT** **PR\_SET\_NAME** **PR\_GET\_NAME** **PR\_SET\_NO\_NEW\_PRIVS** **PR\_GET\_NO\_NEW\_PRIVS** **PR\_PAC\_RESET\_KEYS** **PR\_SET\_PDEATHSIG** **PR\_GET\_PDEATHSIG** **PR\_SET\_PTRACER** **PR\_SET\_SECCOMP** **PR\_GET\_SECCOMP** **PR\_SET\_SECUREBITS** **PR\_GET\_SECUREBITS** **PR\_GET\_SPECULATION\_CTRL** **PR\_SET\_SPECULATION\_CTRL** **PR\_SVE\_SET\_VL** **PR\_SVE\_GET\_VL** **PR\_SET\_SYSCALL\_USER\_DISPATCH** **PR\_SET\_TAGGED\_ADDR\_CTRL** **PR\_GET\_TAGGED\_ADDR\_CTRL** **PR\_TASK\_PERF\_EVENTS\_DISABLE** **PR\_TASK\_PERF\_EVENTS\_ENABLE** **PR\_SET\_THP\_DISABLE** **PR\_GET\_THP\_DISABLE** **PR\_GET\_TID\_ADDRESS** **PR\_SET\_TIMERSLACK** **PR\_GET\_TIMERSLACK** **PR\_SET\_TIMING** **PR\_GET\_TIMING** **PR\_SET\_TSC** **PR\_GET\_TSC** **PR\_SET\_UNALIGN** **PR\_GET\_UNALIGN** **PR\_GET\_AUXV** **PR\_SET\_MDWE** **PR\_GET\_MDWE** **PR\_RISCV\_SET\_ICACHE\_FLUSH\_CTX** **PR\_FUTEX\_HASH**

  ## RETURN VALUE

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

## ERRORS

- **EINVAL**

  The value of *op* is not recognized, or not supported on this system.

- **EINVAL**

  An unused argument is nonzero.

## VERSIONS

IRIX has a **prctl**() system call (also introduced in Linux 2.1.44 as irix\_prctl on the MIPS architecture), with prototype

```
ptrdiff_t prctl(int op, int arg2, int arg3);
```

and operations to get the maximum number of processes per user, get the maximum number of processors the calling process can use, find out whether a specified process is currently blocked, get or set the maximum stack size, and so on.

## STANDARDS

Linux.

## HISTORY

Linux 2.1.57, glibc 2.0.6

## CAVEATS

The prototype of the libc wrapper uses a variadic argument list. This makes it necessary to pass the arguments with the right width. When passing numeric constants, such as 0, use a suffix: **0L**.

Careless use of some **prctl**() operations can confuse the user-space run-time environment, so these operations should be used with care.

## SEE ALSO

[**signal**(2)](/signal/2.md), [**PR\_CAP\_AMBIENT**(2const)](/PR_CAP_AMBIENT/2const.md), [**PR\_CAPBSET\_READ**(2const)](/PR_CAPBSET_READ/2const.md), [**PR\_CAPBSET\_DROP**(2const)](/PR_CAPBSET_DROP/2const.md), [**PR\_SET\_CHILD\_SUBREAPER**(2const)](/PR_SET_CHILD_SUBREAPER/2const.md), [**PR\_GET\_CHILD\_SUBREAPER**(2const)](/PR_GET_CHILD_SUBREAPER/2const.md), [**PR\_SET\_DUMPABLE**(2const)](/PR_SET_DUMPABLE/2const.md), [**PR\_GET\_DUMPABLE**(2const)](/PR_GET_DUMPABLE/2const.md), [**PR\_SET\_ENDIAN**(2const)](/PR_SET_ENDIAN/2const.md), [**PR\_GET\_ENDIAN**(2const)](/PR_GET_ENDIAN/2const.md), [**PR\_SET\_FP\_MODE**(2const)](/PR_SET_FP_MODE/2const.md), [**PR\_GET\_FP\_MODE**(2const)](/PR_GET_FP_MODE/2const.md), [**PR\_SET\_FPEMU**(2const)](/PR_SET_FPEMU/2const.md), [**PR\_GET\_FPEMU**(2const)](/PR_GET_FPEMU/2const.md), [**PR\_SET\_FPEXC**(2const)](/PR_SET_FPEXC/2const.md), [**PR\_GET\_FPEXC**(2const)](/PR_GET_FPEXC/2const.md), [**PR\_SET\_IO\_FLUSHER**(2const)](/PR_SET_IO_FLUSHER/2const.md), [**PR\_GET\_IO\_FLUSHER**(2const)](/PR_GET_IO_FLUSHER/2const.md), [**PR\_SET\_KEEPCAPS**(2const)](/PR_SET_KEEPCAPS/2const.md), [**PR\_GET\_KEEPCAPS**(2const)](/PR_GET_KEEPCAPS/2const.md), [**PR\_MCE\_KILL**(2const)](/PR_MCE_KILL/2const.md), [**PR\_MCE\_KILL\_GET**(2const)](/PR_MCE_KILL_GET/2const.md), [**PR\_SET\_MM**(2const)](/PR_SET_MM/2const.md), [**PR\_SET\_VMA**(2const)](/PR_SET_VMA/2const.md), [**PR\_MPX\_ENABLE\_MANAGEMENT**(2const)](/PR_MPX_ENABLE_MANAGEMENT/2const.md), [**PR\_MPX\_DISABLE\_MANAGEMENT**(2const)](/PR_MPX_DISABLE_MANAGEMENT/2const.md), [**PR\_SET\_NAME**(2const)](/PR_SET_NAME/2const.md), [**PR\_GET\_NAME**(2const)](/PR_GET_NAME/2const.md), [**PR\_SET\_NO\_NEW\_PRIVS**(2const)](/PR_SET_NO_NEW_PRIVS/2const.md), [**PR\_GET\_NO\_NEW\_PRIVS**(2const)](/PR_GET_NO_NEW_PRIVS/2const.md), [**PR\_PAC\_RESET\_KEYS**(2const)](/PR_PAC_RESET_KEYS/2const.md), [**PR\_SET\_PDEATHSIG**(2const)](/PR_SET_PDEATHSIG/2const.md), [**PR\_GET\_PDEATHSIG**(2const)](/PR_GET_PDEATHSIG/2const.md), [**PR\_SET\_PTRACER**(2const)](/PR_SET_PTRACER/2const.md), [**PR\_SET\_SECCOMP**(2const)](/PR_SET_SECCOMP/2const.md), [**PR\_GET\_SECCOMP**(2const)](/PR_GET_SECCOMP/2const.md), [**PR\_SET\_SECUREBITS**(2const)](/PR_SET_SECUREBITS/2const.md), [**PR\_GET\_SECUREBITS**(2const)](/PR_GET_SECUREBITS/2const.md), [**PR\_SET\_SPECULATION\_CTRL**(2const)](/PR_SET_SPECULATION_CTRL/2const.md), [**PR\_GET\_SPECULATION\_CTRL**(2const)](/PR_GET_SPECULATION_CTRL/2const.md), [**PR\_SVE\_SET\_VL**(2const)](/PR_SVE_SET_VL/2const.md), [**PR\_SVE\_GET\_VL**(2const)](/PR_SVE_GET_VL/2const.md), [**PR\_SET\_SYSCALL\_USER\_DISPATCH**(2const)](/PR_SET_SYSCALL_USER_DISPATCH/2const.md), [**PR\_SET\_TAGGED\_ADDR\_CTRL**(2const)](/PR_SET_TAGGED_ADDR_CTRL/2const.md), [**PR\_GET\_TAGGED\_ADDR\_CTRL**(2const)](/PR_GET_TAGGED_ADDR_CTRL/2const.md), [**PR\_TASK\_PERF\_EVENTS\_DISABLE**(2const)](/PR_TASK_PERF_EVENTS_DISABLE/2const.md), [**PR\_TASK\_PERF\_EVENTS\_ENABLE**(2const)](/PR_TASK_PERF_EVENTS_ENABLE/2const.md), [**PR\_SET\_THP\_DISABLE**(2const)](/PR_SET_THP_DISABLE/2const.md), [**PR\_GET\_THP\_DISABLE**(2const)](/PR_GET_THP_DISABLE/2const.md), [**PR\_GET\_TID\_ADDRESS**(2const)](/PR_GET_TID_ADDRESS/2const.md), [**PR\_SET\_TIMERSLACK**(2const)](/PR_SET_TIMERSLACK/2const.md), [**PR\_GET\_TIMERSLACK**(2const)](/PR_GET_TIMERSLACK/2const.md), [**PR\_SET\_TIMING**(2const)](/PR_SET_TIMING/2const.md), [**PR\_GET\_TIMING**(2const)](/PR_GET_TIMING/2const.md), [**PR\_SET\_TSC**(2const)](/PR_SET_TSC/2const.md), [**PR\_GET\_TSC**(2const)](/PR_GET_TSC/2const.md), [**PR\_SET\_UNALIGN**(2const)](/PR_SET_UNALIGN/2const.md), [**PR\_GET\_UNALIGN**(2const)](/PR_GET_UNALIGN/2const.md), [**PR\_GET\_AUXV**(2const)](/PR_GET_AUXV/2const.md), [**PR\_SET\_MDWE**(2const)](/PR_SET_MDWE/2const.md), [**PR\_GET\_MDWE**(2const)](/PR_GET_MDWE/2const.md), [**PR\_RISCV\_SET\_ICACHE\_FLUSH\_CTX**(2const)](/PR_RISCV_SET_ICACHE_FLUSH_CTX/2const.md), [**PR\_FUTEX\_HASH**(2const)](/PR_FUTEX_HASH/2const.md), [**core**(5)](/core/5.md)
