PR_GET_ENDIAN(2const)
β¨ PR_GET_ENDIAN(2const) β¨
okay bestie, welcome to the PR_GET_ENDIAN page β it's literally just a little guy that tells you which way your bytes are facing π
(this is a <pink>2const</pink> page, meaning it's one of the prctl(2) constants, not its own syscall, iykyk)
π NAME π
PR_GET_ENDIAN β get the endianness of the calling process π¦
π LIBRARY π
Standard C library (libc, -lc) β yes queen, just link the normal libc and you're good πΈ
π SYNOPSIS π
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_GET_ENDIAN, int *endianness);
π DESCRIPTION π
So basically, you hand it a pointer and it goes "bestie, here's the endianness of the calling process" and drops that answer right at the location that endianness points to. That's it. That's the whole vibe. β¨
π₯ RETURN VALUE π₯
- On success,
0is returned. slay. π - On error,
-1is returned, anderrnois set to tell you exactly what went wrong π (so always check it, fr fr)
π ERRORS π
EFAULTβendiannessis an invalid address. girl. that pointer is not it π
π STANDARDS π
Linux. PowerPC only. (yes, only β this one is niche and it knows it π )
π¦ HISTORY π¦
Linux 2.6.18 (PowerPC). vintage. iconic. π
π SEE ALSO π
okay that's the whole page, you're literally an endianness expert now, no cap π This was brought to you by Linux man-pages 6.20, dated 2026-02-08 β mwah, go forth and prctl responsibly π«Άβ¨
π¦ 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 2002-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