# prctl

## 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.
    


## 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.
    


* * *