PR_SET_MM_ARG_START(2const)
π PR_SET_MM_ARG_START(2const) β¨
okay bestie so this is a Linux man page, from the 2const crew β it's all about PR_SET_MM_ARG_START, PR_SET_MM_ARG_END, PR_SET_MM_ENV_START, and PR_SET_MM_ENV_END, and what they do is modify kernel memory map descriptor fields. yes that's the whole vibe. we're messing with where the kernel thinks your argv and environ live. iconic behavior, honestly π«Ά
π LIBRARY
Standard C library (libc, -lc). the humble little libc, carrying all of us on her back fr fr π
β¨ SYNOPSIS
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_SET_MM, PR_SET_MM_ARG_START, unsigned long addr, 0L, 0L);
int prctl(PR_SET_MM, PR_SET_MM_ARG_END, unsigned long addr, 0L, 0L);
int prctl(PR_SET_MM, PR_SET_MM_ENV_START, unsigned long addr, 0L, 0L);
int prctl(PR_SET_MM, PR_SET_MM_ENV_END, unsigned long addr, 0L, 0L);
like. look at her. four calls, one addr, and three lil 0Ls tagging along for moral support πΈ
π DESCRIPTION
okay so each of these four constants is a different boundary setter, and they're all lowkey just drawing invisible lines around your process memory π«
PR_SET_MM_ARG_STARTβ sets the address above which the program command line is placed.PR_SET_MM_ARG_ENDβ sets the address below which the program command line is placed.PR_SET_MM_ENV_STARTβ sets the address above which the program environment is placed.PR_SET_MM_ENV_ENDβ sets the address below which the program environment is placed.
and now the important part, bestie, do not skip this π
theaddryou pass with these calls should belong to a process stack area. so the corresponding memory area has to be readable, writable, and β depending on how your kernel was configured β have theMAP_GROWSDOWNattribute set (go peek atmmap(2)).
so like. it's giving "yes you can move the boundary but the memory has to actually be eligible" π so valid.
π₯ RETURN VALUE
slay and simple:
- on success,
0is returned β¨ - on error,
-1is returned, anderrnois set to tell you what went wrong π
π ERRORS
EINVALβaddris greater thanTASK_SIZE(that's the limit on the size of the user address space for this architecture).
that's it, that's the whole error list. one (1) singular error and she ate π
π STANDARDS
Linux. periodt.
π¦ HISTORY
Linux 3.5. vintage, but in a cute way π
π SEE ALSO
and that's the whole page, bestie!! go forth and boundary-set responsibly π«Ά
this was PR_SET_MM_ARG_START(2const) from Linux man-pages 6.20, dated 2026-02-08 β mwah, tysm for reading, ily, bye πβ¨π
π¦ 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