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, 0 is returned. slay. πŸ‘‘
  • On error, -1 is returned, and errno is set to tell you exactly what went wrong 😭 (so always check it, fr fr)

πŸ’€ ERRORS πŸ’€

  • EFAULT β€” endianness is 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms