PR_SET_MM_MAP(2const)
β¨ PR_SET_MM_MAP(2const) β¨
okay bestie, gather round π this one lives in the 2const manual and it's all about poking at the kernel's memory map descriptor fields. yes, that kind of memory map. no cap, it's giving "checkpoint/restore gremlin" energy and we're obsessed.
πΈ NAME πΈ
PR_SET_MM_MAP, PR_SET_MM_MAP_SIZE β modify kernel memory map descriptor fields π§
π LIBRARY π
Standard C library (libc, -lc) β the usual queen π
β¨ SYNOPSIS β¨
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_SET_MM, PR_SET_MM_MAP,
struct prctl_mm_map *map, unsigned long size, 0L);
int prctl(PR_SET_MM, PR_SET_MM_MAP_SIZE, unsigned int *size, 0L, 0L);
π DESCRIPTION π
π PR_SET_MM_MAP
This is the one-shot girlie π«Ά β it gives you access to all the addresses that are modifyable with PR_SET_MM(2const), all at once, by handing over a struct prctl_mm_map (which is defined in <linux/prctl.h>, as always). The size argument should provide the size of the struct. literally just tell it how big your struct is and slide it over π
π¦ PR_SET_MM_MAP_SIZE
Returns β via the size argument β the size of the struct prctl_mm_map that the kernel actually expects. So if you're sitting there like "bestie what struct even is this", this is your vibe check β
It lets user space find a compatible struct. teamwork fr fr π
β οΈ okay so important: these features are available only if the kernel is built with the CONFIG_CHECKPOINT_RESTORE option enabled. no config option, no party. π
π RETURN VALUE π
On success, 0 is returned. π₯³ On error, -1 is returned, and errno is set to indicate the error. classic.
π ERRORS π
EINVALβ the third argument is an invalid address. π (yes, that third argument. look at the synopsis. it's themap/sizeslot depending on which call you're doing.)
β STANDARDS β
Linux. π§ icon behavior only.
πΈ HISTORY πΈ
Linux 3.18. an elder, but a cute one. π
π₯ SEE ALSO π₯
prctl(2)PR_SET_MM(2const)PR_SET_MM_START_CODE(2const)PR_SET_MM_END_CODE(2const)PR_SET_MM_START_DATA(2const)PR_SET_MM_END_DATA(2const)PR_SET_MM_START_STACK(2const)PR_SET_MM_START_BRK(2const)PR_SET_MM_BRK(2const)PR_SET_MM_ARG_START(2const)PR_SET_MM_ARG_END(2const)PR_SET_MM_ENV_START(2const)PR_SET_MM_ENV_END(2const)PR_SET_MM_EXE_FILE(2const)
and that's the whole page, bestie, you ate π this lil drop came from Linux man-pages 6.20, dated 2026-02-08 β so go forth and map those descriptors, ily π«Άβ¨π
π¦ 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