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 the map / size slot depending on which call you're doing.)

⭐ STANDARDS ⭐

Linux. 🐧 icon behavior only.

🌸 HISTORY 🌸

Linux 3.18. an elder, but a cute one. πŸ’…

πŸ”₯ SEE ALSO πŸ”₯


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