personality(2)
๐ personality(2) ๐
okay bestie, sit DOWN, we're talking about personality(2) โ yes it's really called that, yes it's a system call, and yes it's in the System Calls Manual, and it's about to be your new obsession ๐ซถ
๐ธ NAME ๐ธ
personality โ set the process execution domain โจ
๐ LIBRARY ๐
Standard C library (libc, -lc) โ the moment you've all been waiting for ๐
๐ SYNOPSIS ๐
#include <sys/personality.h>
int personality(unsigned long persona);
โจ DESCRIPTION โจ
so. Linux supports different execution domains (aka personalities) for every single process, no cap. Among other things, execution domains tell Linux how to map signal numbers into signal actions. The whole execution domain system is literally how Linux gives you limited support for binaries that were compiled under other UNIX-like operating systems. it's giving "we can speak your ex's language, but only a little" ๐ญ
If persona is not 0xffffffff, then personality() sets the caller's execution domain to the value you specified in persona. And if you pass persona as 0xffffffff? That's the โจlook-but-don't-touchโจ move โ it's how you retrieve the current persona without changing it. iconic behavior honestly.
A list of the available execution domains can be found in <sys/personality.h>. The execution domain is a 32-bit value, and the way it's sliced up is so important bestie:
- the top three bytes are set aside for flags that make the kernel modify the behavior of certain system calls, so as to emulate historical or architectural quirks
- the least significant byte is the value defining the personality the kernel should assume ๐
The flag values are as follows:
ADDR_COMPAT_LAYOUT(since Linux 2.6.9) โ with this flag set, provide legacy virtual address space layout.ADDR_NO_RANDOMIZE(since Linux 2.6.12) โ with this flag set, disable address-space-layout randomization.ADDR_LIMIT_32BIT(since Linux 2.2) โ limit the address space to 32 bits.ADDR_LIMIT_3GB(since Linux 2.4.0) โ with this flag set, use0xc0000000as the offset at which to search a virtual memory chunk onmmap(2); otherwise use0xffffe000. Applies to 32-bit x86 processes only.FDPIC_FUNCPTRS(since Linux 2.6.11) โ user-space function pointers to signal handlers point to descriptors. Applies only to ARM ifBINFMT_ELF_FDPICand SuperH.MMAP_PAGE_ZERO(since Linux 2.4.0) โ map page 0 as read-only (to support binaries that depend on this SVr4 behavior).READ_IMPLIES_EXEC(since Linux 2.6.8) โ with this flag set,PROT_READimpliesPROT_EXECformmap(2).SHORT_INODE(since Linux 2.4.0) โ No effect. ๐ yeah. nothing. it does nothing.STICKY_TIMEOUTS(since Linux 1.2.0) โ with this flag set,select(2),pselect(2), andppoll(2)do not modify the returned timeout argument when interrupted by a signal handler.UNAME26(since Linux 3.1) โ haveuname(2)report a2.6.(40+x)version number rather than aMAJOR.xversion number. Added as a stopgap measure to support broken applications that could not handle the kernel version-numbering switch from Linux 2.6.x to Linux 3.x. poor little meow meows ๐WHOLE_SECONDS(since Linux 1.2.0) โ No effect. also nothing. we love a flag that simply exists ๐ง
And now, the available execution domains โจ:
PER_BSD(since Linux 1.2.0) โ BSD. (No effects.)PER_HPUX(since Linux 2.4) โ Support for 32-bit HP/UX. This support was never complete, and was dropped so that since Linux 4.0, this value has no effect.PER_IRIX32(since Linux 2.2) โ IRIX 5 32-bit. Never fully functional; support dropped in Linux 2.6.27. ImpliesSTICKY_TIMEOUTS.PER_IRIX64(since Linux 2.2) โ IRIX 6 64-bit. ImpliesSTICKY_TIMEOUTS; otherwise no effect.PER_IRIXN32(since Linux 2.2) โ IRIX 6 new 32-bit. ImpliesSTICKY_TIMEOUTS; otherwise no effect.PER_ISCR4(since Linux 1.2.0) โ ImpliesSTICKY_TIMEOUTS; otherwise no effect.PER_LINUX(since Linux 1.2.0) โ Linux. (the main character, obviously ๐)PER_LINUX32(since Linux 2.2) โuname(2)returns the name of the 32-bit architecture in the machine field ("i686"instead of"x86_64", &c.).- Under ia64 (Itanium), processes with this personality don't have the
O_LARGEFILEopen(2)flag forced. - Under 64-bit ARM, setting this personality is forbidden if
execve(2)ing a 32-bit process would also be forbidden (cf. theallow_mismatched_32bit_el0kernel parameter andDocumentation/arm64/asymmetric-32bit.rst).
- Under ia64 (Itanium), processes with this personality don't have the
PER_LINUX32_3GB(since Linux 2.4) โ Same asPER_LINUX32, but impliesADDR_LIMIT_3GB.PER_LINUX_32BIT(since Linux 2.0) โ Same asPER_LINUX, but impliesADDR_LIMIT_32BIT.PER_LINUX_FDPIC(since Linux 2.6.11) โ Same asPER_LINUX, but impliesFDPIC_FUNCPTRS.PER_OSF4(since Linux 2.4) โ OSF/1 v4. No effect since Linux 6.1, which removed a.out binary support. Before, on alpha, would clear top 32 bits ofiov_lenin the user's buffer for compatibility with old versions of OSF/1 whereiov_lenwas defined as. int.PER_OSR5(since Linux 2.4) โ SCO OpenServer 5. ImpliesSTICKY_TIMEOUTSandWHOLE_SECONDS; otherwise no effect.PER_RISCOS(since Linux 2.3.7; macro since Linux 2.3.13) โ Acorn RISC OS/Arthur (MIPS). No effect. Up to Linux 4.0, would set the emulation altroot to/usr/gnemul/riscos(cf.PER_SUNOS, below). Before then, up to Linux 2.6.3, just Arthur emulation.PER_SCOSVR3(since Linux 1.2.0) โ SCO UNIX System V Release 3. Same asPER_OSR5, but also impliesSHORT_INODE.PER_SOLARIS(since Linux 2.4) โ Solaris. ImpliesSTICKY_TIMEOUTS; otherwise no effect.PER_SUNOS(since Linux 2.4.0) โ Sun OS. Same asPER_BSD, but impliesSTICKY_TIMEOUTS. Prior to Linux 2.6.26, diverted library and dynamic linker searches to/usr/gnemul. Buggy, largely unmaintained, and almost entirely unused. ๐ฉ bestie this one is a red flag, not a green one.PER_SVR3(since Linux 1.2.0) โ AT&T UNIX System V Release 3. ImpliesSTICKY_TIMEOUTSandSHORT_INODE; otherwise no effect.PER_SVR4(since Linux 1.2.0) โ AT&T UNIX System V Release 4. ImpliesSTICKY_TIMEOUTSandMMAP_PAGE_ZERO; otherwise no effect.PER_UW7(since Linux 2.4) โ UnixWare 7. ImpliesSTICKY_TIMEOUTSandMMAP_PAGE_ZERO; otherwise no effect.PER_WYSEV386(since Linux 1.2.0) โ WYSE UNIX System V/386. ImpliesSTICKY_TIMEOUTSandSHORT_INODE; otherwise no effect.PER_XENIX(since Linux 1.2.0) โ XENIX. ImpliesSTICKY_TIMEOUTSandSHORT_INODE; otherwise no effect.
๐ฆ RETURN VALUE ๐ฆ
On success, the previous persona is returned. โจ
On error, -1 is returned, and errno is set to indicate the error. ๐
๐ ERRORS ๐
EINVALโ The kernel was unable to change the personality.
๐ STANDARDS ๐
Linux. ๐ง (that's it. that's the standard.)
๐ HISTORY ๐
Linux 1.1.20, glibc 2.3.
โญ SEE ALSO โญ
setarch(8) โ go read it bestie, iykyk ๐
and that's the whole page, periodt. ๐ this little slice of lore came to you from Linux man-pages 6.20, dated 2026-02-08, so if you're citing it in the group chat, that's the version. stay slaying, stay sticky-timeout-ing ๐ซถโจ๐
๐ฆ 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 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
- Copyright 2016, 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