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 β€” addr is greater than TASK_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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms