PR_SET_MM_START_DATA(2const)
β¨ PR_SET_MM_START_DATA π PR_SET_MM_END_DATA β¨
okay bestie, so this is a <rainbow>2const</rainbow> page β that's the lil family of man pages that just documents a handful of related constants, no full api plotline. today's main characters are PR_SET_MM_START_DATA and PR_SET_MM_END_DATA, and they live in the prctl(2) universe. we're talking kernel memory map descriptor fields here. very demure, very powerful, handle with care π
π LIBRARY
Standard C library β libc, -lc. yes queen, you just link it π
π SYNOPSIS
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_SET_MM, PR_SET_MM_START_DATA, unsigned long addr, 0L, 0L);
int prctl(PR_SET_MM, PR_SET_MM_END_DATA, unsigned long addr, 0L, 0L);
not me dropping the exact same function twice with a lil different constant π«Ά both go through prctl(2) with PR_SET_MM as the first arg, addr as the third, and then 0L, 0L because those last two slots are just there vibing. don't touch 'em.
πΈ DESCRIPTION
PR_SET_MM_START_DATAβ sets the address above which initialized and uninitialized (bss) data get placed. the corresponding memory area has to be readable and writable, but not executable and not shareable. that's the vibe check it has to pass.PR_SET_MM_END_DATAβ sets the address below which initialized and uninitialized (bss) data get placed. same energy: the corresponding memory area must be readable and writable, and absolutely not executable or shareable.
so one is the ceiling and one is the floor, and together they're giving "here's the box where my data lives" π¦β¨ iconic honestly.
π₯ RETURN VALUE
slay β 0 is returned on success. flop β -1 comes back, and errno gets set to tell you exactly which error it is. no cap.
π ERRORS
EINVALβaddris greater thanTASK_SIZE(that's the limit on the size of the user address space for this architecture). basically you aimed past the end of the map, bestie πEINVALβ the permissions of the corresponding memory area are not as required. you promised readable + writable, not executable, not shareable, and the area said "no <3"
π STANDARDS
Linux. that's it, that's the whole section. periodt.
π¦ HISTORY
Linux 3.3. ancient in kernel years, still eating π
π SEE ALSO
and that's the whole page, bestie!! this lil masterpiece came from the Linux man-pages 6.20 collection, dated 2026-02-08, and it lives at PR_SET_MM_START_DATA(2const). go forth and set your data boundaries 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 2012, Cyrill Gorcunov <gorcunov@gmail.com>
- Copyright 2012-2015, 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