PR_SET_UNALIGN(2const)
π PR_SET_UNALIGN π
okay bestie, welcome to the PR_SET_UNALIGN(2const) era of your life β¨ it's a prctl(2) constant, it lives in the Linux man-pages, and it is lowkey one of the most niche-but-iconic little ops you'll ever run. let's get into it π
πΈ NAME πΈ
PR_SET_UNALIGN β set unaligned access control bits π¦
π LIBRARY π
Standard C library (libc, -lc) π
β¨ SYNOPSIS β¨
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_SET_UNALIGN, unsigned long flag);
like yes, it's a prctl call, but a very specific flavor of one π
π«Ά DESCRIPTION π«Ά
So basically, this sets the unaligned access control bits to arg2. That's the whole vibe check. π
You pass in one of two named flags:
PR_UNALIGN_NOPRINTβ this one makes the kernel silently fix up unaligned user accesses. no drama, no noise, just quietly handling it. π€«PR_UNALIGN_SIGBUSβ this one says "nope, I'm gonna make a whole scene" and generatesSIGBUSon unaligned user access. π dramatic but valid.
and THEN, plot twist π¬ β Alpha also supports an additional flag with the value of 4, and it has no corresponding named constant (rude, honestly). it instructs the kernel to not fix up unaligned accesses at all. it's analogous to providing the UAC_NOFIX flag in the SSI_NVPAIRS operation of the setsysinfo() system call on Tru64. iykyk π§
β RETURN VALUE β
- On success:
0is returned. slay. β - On error:
-1is returned, anderrnois set to indicate the error. the audacity π
π ERRORS π
EINVALβflagis not a valid value. bestie. that flag is not it. π
π STANDARDS π
Linux. π
π HISTORY π
This one is only on:
- ia64, since Linux 2.3.48
- parisc, since Linux 2.6.15
- PowerPC, since Linux 2.6.18
- Alpha, since Linux 2.6.22
- sh, since Linux 2.6.34
- tile, since Linux 3.12
like it's giving architecture-exclusive β¨ main character energy only on those platforms β¨
π₯ SEE ALSO π₯
fr fr, if your arch isn't on that history list, this constant just isn't gonna hit the same. vibe check your architecture first π
mwah π this page came to you courtesy of Linux man-pages 6.20, dated 2026-02-08. go forth and align your accesses, 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
- Copyright 2006-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