---
name: "PR_SVE_SET_VL"
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_SVE_SET_VL"
---

# PR\_SVE\_SET\_VL(2const)

set the thread's SVE vector length

## NAME

PR\_SVE\_SET\_VL - set the thread's SVE vector length

## LIBRARY

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

## SYNOPSIS

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

**int prctl(PR\_SVE\_SET\_VL, unsigned long** *val***);**

## DESCRIPTION

Configure the thread's SVE vector length, as specified by *val*.

The bits of *val* corresponding to **PR\_SVE\_VL\_LEN\_MASK** must be set to the desired vector length in bytes. This is interpreted as an upper bound: the kernel will select the greatest available vector length that does not exceed the value specified. In particular, specifying **SVE\_VL\_MAX** (defined in *\<asm/sigcontext.h\>)* for the **PR\_SVE\_VL\_LEN\_MASK** bits requests the maximum supported vector length.

In addition, the other bits of *val* must be set to one of the following combinations of flags:

- **0L**

  Perform the change immediately. At the next [**execve**(2)](/execve/2.md) in the thread, the vector length will be reset to the value configured in */proc/sys/abi/sve\_default\_vector\_length*.

- **PR\_SVE\_VL\_INHERIT**

  Perform the change immediately. Subsequent [**execve**(2)](/execve/2.md) calls will preserve the new vector length.

- **PR\_SVE\_SET\_VL\_ONEXEC**

  Defer the change, so that it is performed at the next [**execve**(2)](/execve/2.md) in the thread. Further [**execve**(2)](/execve/2.md) calls will reset the vector length to the value configured in */proc/sys/abi/sve\_default\_vector\_length*.

- **PR\_SVE\_SET\_VL\_ONEXEC \| PR\_SVE\_VL\_INHERIT**

  Defer the change, so that it is performed at the next [**execve**(2)](/execve/2.md) in the thread. Further [**execve**(2)](/execve/2.md) calls will preserve the new vector length.

In all cases, any previously pending deferred change is canceled.

On success, a nonnegative value is returned that describes the *selected* configuration. If **PR\_SVE\_SET\_VL\_ONEXEC** was included in *val*, then the configuration described by the return value will take effect at the next [**execve**(2)](/execve/2.md). Otherwise, the configuration is already in effect when the **PR\_SVE\_SET\_VL** call returns. In either case, the value is encoded in the same way as the return value of **PR\_SVE\_GET\_VL**. Note that there is no explicit flag in the return value corresponding to **PR\_SVE\_SET\_VL\_ONEXEC**.

The configuration (including any pending deferred change) is inherited across [**fork**(2)](/fork/2.md) and [**clone**(2)](/clone/2.md).

## RETURN VALUE

On success, **PR\_SVE\_SET\_VL** returns the nonnegative value described above. On error, -1 is returned, and *errno* is set to indicate the error.

## ERRORS

- **EINVAL**

  SVE is not available on this platform.

- **EINVAL**

  The value in the bits of *val* corresponding to **PR\_SVE\_VL\_LEN\_MASK** is outside the range \[**SVE\_VL\_MIN**, **SVE\_VL\_MAX**\] or is not a multiple of 16.

- **EINVAL**

  The other bits of *val* are invalid or unsupported.

## FILES

- */proc/sys/abi/sve\_default\_vector\_length*

  ## STANDARDS

Linux. arm64 only.

## HISTORY

Linux 4.15 (arm64).

## CAVEATS

Because the compiler or run-time environment may be using SVE, using this call without the **PR\_SVE\_SET\_VL\_ONEXEC** flag may crash the calling process. The conditions for using it safely are complex and system-dependent. Don't use it unless you really know what you are doing.

## SEE ALSO

[**prctl**(2)](/prctl/2.md), [**PR\_SVE\_GET\_VL**(2const)](/PR_SVE_GET_VL/2const.md)

For more information, see the kernel source file *Documentation/arch/arm64/sve.rst*.
