PR_MCE_KILL_SET(2const)

πŸ’… PR_MCE_KILL_SET (a 2const moment) ✨

okay bestie, so this is one of those little constant pages that rides along with prctl(2) β€” it's the manual page PR_MCE_KILL_SET, and honestly? it's giving "short but important." no cap. πŸŽ€


πŸ¦‹ NAME πŸ¦‹

PR_MCE_KILL_SET β€” set the machine check memory corruption kill policy

like... you're literally deciding how your process gets taken out when the hardware starts lying to you. main character energy fr fr πŸ’€

πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc)

the classic. the iconique. linking against it as we speak 🫢

✨ SYNOPSIS ✨

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

int prctl(PR_MCE_KILL, PR_MCE_KILL_SET, long pol, 0L, 0L);

so you #include both headers β€” yes BOTH, the linux/prctl.h one is where the PR_* constants live, iykyk β€” and then you call prctl(2) with PR_MCE_KILL as the first arg, PR_MCE_KILL_SET as the second, your pol sitting in the third slot, and then... 0L, 0L. those two trailing zeros are just vibing there. they're required, they're unused, they're iconic. 🌸

πŸŽ€ DESCRIPTION πŸŽ€

so what you're doing here is setting a thread-specific memory corruption kill policy. like, this thread gets its own rules. not the whole process, not the system β€” just this lil thread. periodt.

and pol is the whole personality of the thing. it's gotta be one of these three:

  • PR_MCE_KILL_EARLY β€” the early kill vibe. πŸ”₯
  • PR_MCE_KILL_LATE β€” the late kill vibe. πŸ•°οΈ
  • PR_MCE_KILL_DEFAULT β€” whatever the system-wide default is. the "I trust the universe" option. 🌈
Early kill means the thread receives a SIGBUS signal as soon as hardware memory corruption is detected inside its address space. like, immediately. the second the vibes go bad. 😭
Late kill mode is different β€” the process is only killed when it accesses a corrupted page. so it can keep chilling until it actually touches the bad memory. πŸ™ˆ

and if you want the full tea on what SIGBUS actually is and how it behaves, go read sigaction(2). your girl doesn't gatekeep. πŸ’–

⭐ RETURN VALUE ⭐

  • On success β€” 0 is returned. slay. πŸ’…
  • On error β€” -1 is returned, and errno is set to tell you what went wrong.

no gray area. it's either 0 or it's a whole mood. πŸ‘‘

πŸ’€ ERRORS πŸ’€

  • EINVAL β€” pol is not a valid value.

that's the one and only error on the list. so if your pol is some made-up nonsense, this is the check that catches you. don't test it. πŸ“

🌟 STANDARDS 🌟

Linux.

just Linux. that's the whole section. she said what she said. 🧚

πŸ’œ HISTORY πŸ’œ

Linux 2.6.32.

ancient. a legend. she's been here since 2.6.32 and she's not leaving. πŸ‘‘

πŸ‘€ SEE ALSO πŸ‘€

go read the parent page prctl(2) for the big picture, and PR_MCE_KILL(2const) for the sibling constants β€” they're a matched set, fr fr. πŸ’–


and that's the whole page bestie!! written up in Linux man-pages 6.20, dated 2026-02-08 β€” so you know it's fresh, you know it's accurate, and you know your girl did the reading so you don't have to. 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms