1 .\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
2 .\" and Copyright (C) 2016, Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
26 .\" Created Sat Aug 21 1995 Thomas K. Dyas <tdyas@eden.rutgers.edu>
28 .\" typo corrected, aeb, 950825
29 .\" added layout change from joey, 960722
30 .\" changed prototype, documented 0xffffffff, aeb, 030101
31 .\" Modified 2004-11-03 patch from Martin Schulze <joey@infodrom.org>
33 .TH PERSONALITY 2 2021-03-22 "Linux" "Linux Programmer's Manual"
35 personality \- set the process execution domain
38 .B #include <sys/personality.h>
40 .BI "int personality(unsigned long " persona );
43 Linux supports different execution domains, or personalities, for each
45 Among other things, execution domains tell Linux how to map
46 signal numbers into signal actions.
47 The execution domain system allows
48 Linux to provide limited support for binaries compiled under other
49 UNIX-like operating systems.
56 sets the caller's execution domain to the value specified by
60 as 0xffffffff provides a way of retrieving
61 the current persona without changing it.
63 A list of the available execution domains can be found in
64 .IR <sys/personality.h> .
65 The execution domain is a 32-bit value in which the top three
66 bytes are set aside for flags that cause the kernel to modify the
67 behavior of certain system calls so as to emulate historical or
69 The least significant byte is a value defining the personality
70 the kernel should assume.
71 The flag values are as follows:
73 .BR ADDR_COMPAT_LAYOUT " (since Linux 2.6.9)"
74 With this flag set, provide legacy virtual address space layout.
76 .BR ADDR_NO_RANDOMIZE " (since Linux 2.6.12)"
77 With this flag set, disable address-space-layout randomization.
79 .BR ADDR_LIMIT_32BIT " (since Linux 2.2)"
80 Limit the address space to 32 bits.
82 .BR ADDR_LIMIT_3GB " (since Linux 2.4.0)"
83 With this flag set, use 0xc0000000 as the offset at which to search
84 a virtual memory chunk on
86 otherwise use 0xffffe000.
88 .BR FDPIC_FUNCPTRS " (since Linux 2.6.11)"
89 User-space function pointers to signal handlers point
90 (on certain architectures) to descriptors.
92 .BR MMAP_PAGE_ZERO " (since Linux 2.4.0)"
93 Map page 0 as read-only
94 (to support binaries that depend on this SVr4 behavior).
96 .BR READ_IMPLIES_EXEC " (since Linux 2.6.8)"
104 .BR SHORT_INODE " (since Linux 2.4.0)"
107 .BR STICKY_TIMEOUTS " (since Linux 1.2.0)"
113 do not modify the returned timeout argument when
114 interrupted by a signal handler.
116 .BR UNAME26 " (since Linux 3.1)"
119 report a 2.6.40+ version number rather than a 3.x version number.
120 Added as a stopgap measure to support broken applications that
121 could not handle the kernel version-numbering switch from 2.6.x to 3.x.
123 .BR WHOLE_SECONDS " (since Linux 1.2.0)"
126 The available execution domains are:
128 .BR PER_BSD " (since Linux 1.2.0)"
131 .BR PER_HPUX " (since Linux 2.4)"
132 Support for 32-bit HP/UX.
133 This support was never complete, and was dropped so that since Linux 4.0,
134 this value has no effect.
136 .BR PER_IRIX32 " (since Linux 2.2)"
138 Never fully functional; support dropped in Linux 2.6.27.
140 .BR STICKY_TIMEOUTS .
142 .BR PER_IRIX64 " (since Linux 2.2)"
145 .BR STICKY_TIMEOUTS ;
146 otherwise no effects.
148 .BR PER_IRIXN32 " (since Linux 2.2)"
151 .BR STICKY_TIMEOUTS ;
152 otherwise no effects.
154 .BR PER_ISCR4 " (since Linux 1.2.0)"
156 .BR STICKY_TIMEOUTS ;
157 otherwise no effects.
159 .BR PER_LINUX " (since Linux 1.2.0)"
162 .BR PER_LINUX32 " (since Linux 2.2)"
165 .BR PER_LINUX32_3GB " (since Linux 2.4)"
169 .BR PER_LINUX_32BIT " (since Linux 2.0)"
171 .BR ADDR_LIMIT_32BIT .
173 .BR PER_LINUX_FDPIC " (since Linux 2.6.11)"
177 .BR PER_OSF4 " (since Linux 2.4)"
180 .\" Following is from a comment in arch/alpha/kernel/osf_sys.c
181 clear top 32 bits of iov_len in the user's buffer for
182 compatibility with old versions of OSF/1 where iov_len
186 .BR PER_OSR5 " (since Linux 2.4)"
191 otherwise no effects.
193 .BR PER_RISCOS " (since Linux 2.2)"
196 .BR PER_SCOSVR3 " (since Linux 1.2.0)"
198 .BR STICKY_TIMEOUTS ,
202 otherwise no effects.
204 .BR PER_SOLARIS " (since Linux 2.4)"
206 .BR STICKY_TIMEOUTS ;
207 otherwise no effects.
209 .BR PER_SUNOS " (since Linux 2.4.0)"
211 .BR STICKY_TIMEOUTS .
212 Divert library and dynamic linker searches to
214 Buggy, largely unmaintained, and almost entirely unused;
215 support was removed in Linux 2.6.26.
217 .BR PER_SVR3 " (since Linux 1.2.0)"
222 otherwise no effects.
224 .BR PER_SVR4 " (since Linux 1.2.0)"
229 otherwise no effects.
231 .BR PER_UW7 " (since Linux 2.4)"
236 otherwise no effects.
238 .BR PER_WYSEV386 " (since Linux 1.2.0)"
243 otherwise no effects.
245 .BR PER_XENIX " (since Linux 1.2.0)"
250 otherwise no effects.
252 On success, the previous
255 On error, \-1 is returned, and
257 is set to indicate the error.
261 The kernel was unable to change the personality.
263 This system call first appeared in Linux 1.1.20
264 (and thus first in a stable kernel release with Linux 1.2.0);
265 library support was added in glibc 2.3.
266 .\" personality wrapper first appeared in glibc 1.90,
267 .\" <sys/personality.h> was added later in 2.2.91.
270 is Linux-specific and should not be used in programs intended to