PR_SVE_SET_VL(2const)
π PR_SVE_SET_VL(2const) π
okay bestie, this is a page from the 2const corner of the Linux man-pages universe, and it's about SVE vector lengths on arm64. buckle up π
β¨ NAME β¨
PR_SVE_SET_VL β set the thread's SVE vector length π¦
π LIBRARY π
Standard C library (libc, -lc) β the classic π
π§ SYNOPSIS π§
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_SVE_SET_VL, unsigned long val);
πΈ DESCRIPTION πΈ
So, you're configuring the thread's SVE vector length, as specified by val. that's the whole vibe.
The bits of val that correspond to PR_SVE_VL_LEN_MASK must be set to the desired vector length in bytes. and here's the cute part β it's interpreted as an upper bound: the kernel will pick the greatest available vector length that does not exceed the value you specified. so if you're feeling β¨extraβ¨ and you want the absolute maximum, you set the PR_SVE_VL_LEN_MASK bits to SVE_VL_MAX (which lives in <asm/sigcontext.h>) and you get the max supported vector length. periodt.
Also, the other bits of val must be set to one of these flag combos:
0Lβ do the change immediately. but at the nextexecve(2)in the thread, the vector length gets reset to the value configured in/proc/sys/abi/sve_default_vector_length. so it's giving temporary πPR_SVE_VL_INHERITβ do the change immediately, and subsequentexecve(2)calls will preserve the new vector length. long-term commitment, we love to see it π«ΆPR_SVE_SET_VL_ONEXECβ defer the change so it happens at the nextexecve(2)in the thread. furtherexecve(2)calls will reset the vector length to the value configured in/proc/sys/abi/sve_default_vector_length. one-time thing, no strings πPR_SVE_SET_VL_ONEXEC | PR_SVE_VL_INHERITβ defer the change so it happens at the nextexecve(2)in the thread, and furtherexecve(2)calls will preserve the new vector length. delayed and permanent, main character energy π
In all cases, any previously pending deferred change is canceled. gone. cancelled, as the kids say π«
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). otherwise, the configuration is already in effect when the PR_SVE_SET_VL call returns. either way, the value is encoded in the exact same way as the return value of PR_SVE_GET_VL. and heads up: there is no explicit flag in the return value corresponding to PR_SVE_SET_VL_ONEXEC. iykyk π
The configuration (including any pending deferred change) is inherited across fork(2) and clone(2). it runs in the family π
π« 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. classic. π€
π¨ ERRORS π¨
EINVALβ SVE is not available on this platform. not today, bestie πEINVALβ the value in the bits ofvalcorresponding toPR_SVE_VL_LEN_MASKis outside the range[SVE_VL_MIN, SVE_VL_MAX]or is not a multiple of 16.EINVALβ the other bits ofvalare invalid or unsupported.
π FILES π
/proc/sys/abi/sve_default_vector_length
π STANDARDS π
Linux. arm64 only. sorry x86 girlies, this one's not for you π
π°οΈ HISTORY π°οΈ
Linux 4.15 (arm64). vintage but iconic β¨
β οΈ 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. so likeβ¦ don't use it unless you really know what you are doing. fr fr. this is not a vibe-check-and-see situation, this is a read-the-docs-three-times situation π
π SEE ALSO π
For more information, see the kernel source file Documentation/arch/arm64/sve.rst.
and that's the whole page, bestie! this one's from Linux man-pages 6.20, dated 2026-02-08, and it's PR_SVE_SET_VL(2const). go forth and vector responsibly π
β¨π¦
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 2020, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms