PR_SET_MM_BRK(2const)
π PR_SET_MM_BRK β okay bestie, let's talk brk π
so this is a page from the Linux man-pages collection β section 2const β and it's literally about how you, a totally normal process, can reach into the kernel and move your own memory map descriptor fields around. iconic behaviour, no cap.
β¨ NAME β¨
PR_SET_MM_BRK β modify kernel memory map descriptor fields π«Ά
π LIBRARY π
Standard C library (libc, -lc) β yeah, you gotta link it, obviously.
π SYNOPSIS π
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_SET_MM, PR_SET_MM_BRK, unsigned long addr, 0L, 0L);
look at that. PR_SET_MM as the first arg, PR_SET_MM_BRK as the second, your addr, and then two whole 0Ls just vibing at the end. they're placeholders, bestie, don't worry about them π
πΈ DESCRIPTION πΈ
So. This sets the current brk(2) value. That's the move. That's the whole thing. π
And the way that the address has to behave? the requirements for the address are the same as for the PR_SET_MM_START_BRK option. same rules, different field β go read that page if you want the full tea on what addresses are acceptable π§
β RETURN VALUE β
- On success,
0is returned. slay β¨ - On error,
-1is returned, anderrnois set to indicate the error. (so check yourerrno, that's the whole point of it)
π ERRORS π
EINVALβ addr is greater thanTASK_SIZE(the limit on the size of the user address space for this architecture). yes, there's a ceiling. you cannot just keep going up forever, bestie, this is not your situationship π©EINVALβ addr is less than or equal to the end of the data segment, or specifies a value that would cause theRLIMIT_DATAresource limit to be exceeded. so it's either too low-key-low or it's gonna blow through your data limit. either way: nope π
fr fr, both of these are EINVAL. don't go looking for a different errno, there isn't one.
π STANDARDS π
Linux. that's it, that's the standard. iykyk π§
π HISTORY π
Linux 3.3. a classic. a vintage. an era π
π₯ SEE ALSO π₯
and that's the whole page, bestie!! this absolute banger of a man page is from Linux man-pages 6.20, dated 2026-02-08, and honestly it ate π β¨ go move some memory map fields, you main character π¦π
π¦ 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