PR_SET_VMA(2const)
π PR_SET_VMA π
okay bestie, welcome to PR_SET_VMA, a.k.a. the little prctl(2) operation that lets you slap an attribute onto a virtual memory area. that's literally the whole job. she sets attributes. she's an icon, she's a legend, and she is the moment β¨
this page lives in section 2const of the manual (iykyk), and if you need more context on the parent function you'll wanna peek at prctl(2) β we link it down in SEE ALSO, no gatekeeping here π«Ά
πΈ LIBRARY πΈ
Standard C library (libc, -lc). yes ma'am, the classic. nothing exotic.
β¨ SYNOPSIS β¨
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_SET_VMA, long attr, unsigned long addr, unsigned long size,
const char *_Nullable val);
not me including both headersβ¦ you do actually need both, so don't skip one π
π DESCRIPTION π
so here's the vibe: we set an attribute β that's the one named in attr β for virtual memory areas that start at the address in addr and span for size. and val is the value of the attribute you're setting. that's the trio. addr, size, val. slay π₯
β οΈ heads up bestie: slapping an attribute onto a virtual memory area might stop it from getting merged with adjacent virtual memory areas, because that attribute's value is now different. so likeβ¦ she's special now, she can't just merge into the crowd π
Currently, attr must be one of:
PR_SET_VMA_ANON_NAMEβ this one sets a name for anonymous virtual memory areas, which is lowkey the cutest feature here πvalshould be a pointer to a null-terminated string containing the name. the name length, including the null byte, cannot exceed 80 bytes. and ifvalisNULL, the name of the appropriate anonymous virtual memory areas gets reset. as for the name itself, it can contain only printable ascii characters (that'sisprint(3)) β except'[',']','\','$', and'`'. yeah. those five are banned from the group chat π«
π RETURN VALUE π
- success? you get
0. periodt. - error? you get
-1, anderrnogets set to tell you what went wrong.
π ERRORS π
EINVALβattris not a valid attribute. girl, that's not a real attribute πEINVALβaddris an invalid address. that address is not it fr fr.
π STANDARDS π
Linux. that's it, that's the standard. π§
π¦ HISTORY π¦
Linux 5.17. so she's a relatively recent queen, born in 2022, already glowing β¨
π SEE ALSO π
prctl(2)β the main character of the whole family, go read her
okay that's the whole page bestie, you're fully caught up, go set some VMAs π«Ά
this was brought to you by Linux man-pages 6.20, dated 2026-02-08 β yes the date is in the future, don't think about it, just vibe πΈπβ¨
π¦ 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 2021, Colin Cross <ccross@google.com>
- Copyright 2023, Nick Gregory <nick@nickgregory.me>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms