PR_GET_MDWE(2const)

πŸ’– PR_GET_MDWE πŸ’–

okay so bestie, welcome to the PR_GET_MDWE page from the Linux man-pages (that's the 2const section, we love a const page, it's giving reference material ✨). This is the one where you ask the kernel "hey queen, what's my Memory-Deny-Write-Execute protection mask looking like rn?" πŸ‘‘


πŸŽ€ NAME πŸŽ€

PR_GET_MDWE β€” get the Memory-Deny-Write-Execute protection mask for the calling process πŸ¦‹

like, for the calling process, not somebody else's. it's about you. main character energy fr fr πŸ’…


πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc) 🌸


✨ SYNOPSIS ✨

#include <linux/prctl.h>  /* Definition of PR_* constants */
#include <sys/prctl.h>

int prctl(PR_GET_MDWE, 0L, 0L, 0L, 0L);

no cap, look at those args β€” four little 0Ls just vibing there doing absolutely nothing πŸ™ˆ they're placeholders, we're not here for them, we're here for the mask.


πŸ’œ DESCRIPTION πŸ’œ

So what this does: it returns the Memory-Deny-Write-Execute protection mask of the calling process. That's it. That's the whole job. 🫢

and if you wanna know what the actual bits in that mask mean?? girl, go read PR_SET_MDWE(2const), because that's where the protection mask bits get explained. This page is not the bits page. This page is the getter. iykyk 😌


πŸ“ RETURN VALUE πŸ“

  • On success β€” a nonnegative value comes back πŸŽ‰ (that's your mask, bestie)
  • On error β€” -1 returns 😭 and errno gets set to tell you what went wrong

🌈 STANDARDS 🌈

Linux. that's it, that's the standard, periodt. πŸ’€


⭐ HISTORY ⭐

Linux 6.3 🧚 so it's a newer baby, be nice to it.


πŸ‘‘ SEE ALSO πŸ‘‘

  • prctl(2) β€” the parent function, the whole reason we're here
  • PR_SET_MDWE(2const) β€” the setter sibling, the one with the actual mask bits explained πŸ”₯

πŸ’– psst β€” seriously, if you're confused about what the mask bits even mean, PR_SET_MDWE(2const) is right there. this page assumes you already know. no gatekeeping, just pointing you to the lore πŸ“–

okay that's the whole page, you ate that, go protect some memory πŸ’…βœ¨


with love from Linux man-pages 6.20, dated 2025-05-17 β€” mwah, kisses, bye bestie πŸŽ€πŸ¦‹

πŸ“¦ 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