PR_SET_MM_START_STACK(2const)
π PR_SET_MM_START_STACK π
okay bestie, so this is a page from the Linux man-pages (section 2const, the constant-definition girlies) and it's all about one very specific little knob you can twist in the kernel. buckle up π
πΈ NAME πΈ
PR_SET_MM_START_STACK β modify kernel memory map descriptor fields β¨
π«Ά LIBRARY π«Ά
Standard C library (libc, -lc) π
β¨ SYNOPSIS β¨
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_SET_MM, PR_SET_MM_START_STACK, unsigned long addr, 0L, 0L);
so yes, this is not its own function, it's a sub-operation of prctl(2) β you pass PR_SET_MM as the first arg (that's the "we're editing the memory map descriptors" mode π§) and PR_SET_MM_START_STACK as the second arg to say which field you're touching. the last three args are literally addr, 0L, 0L. no cap.
π DESCRIPTION π
Set the start address of the stack. π
and bestie, heads up: the corresponding memory area must be readable and writable. like, that's the vibe check it has to pass. if it can't be read and written, we have a problem π
π RETURN VALUE π
- On success,
0is returned. slay. β¨ - On error,
-1is returned, anderrnois set to indicate the error. π
π₯ ERRORS π₯
EINVALβ addr is greater thanTASK_SIZE(the limit on the size of the user address space for this architecture). so, too big for this architecture's address space, and it said no πEINVALβ The permissions of the corresponding memory area are not as required. i.e. it wasn't readable and writable like we just talked about. the memory area did NOT serve π
π¦ STANDARDS π¦
Linux. π§ (that's the whole entry, she's lowkey iconic like that)
β HISTORY β
Linux 3.3. yes she's been around since 3.3, a true elder of the mmap-adjacent ecosystem π
π SEE ALSO π
and that's the whole page, bestie!! π this was PR_SET_MM_START_STACK(2const) from the Linux man-pages, version 6.20, dated 2026-02-08 β written down, loved, and explained with maximum enthusiasm. go forth and set your stack start address (readable + writable, always). mwah π
πΈπ«Ά
π¦ 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