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 2017-09-15 "Linux" "Linux Programmer's Manual"
35 personality \- set the process execution domain
37 .B #include <sys/personality.h>
39 .BI "int personality(unsigned long " persona );
41 Linux supports different execution domains, or personalities, for each
43 Among other things, execution domains tell Linux how to map
44 signal numbers into signal actions.
45 The execution domain system allows
46 Linux to provide limited support for binaries compiled under other
47 UNIX-like operating systems.
54 sets the caller's execution domain to the value specified by
58 as 0xffffffff provides a way of retrieving
59 the current persona without changing it.
61 A list of the available execution domains can be found in
62 .IR <sys/personality.h> .
63 The execution domain is a 32-bit value in which the top three
64 bytes are set aside for flags that cause the kernel to modify the
65 behavior of certain system calls so as to emulate historical or
67 The least significant byte is a value defining the personality
68 the kernel should assume.
69 The flag values are as follows:
71 .BR ADDR_COMPAT_LAYOUT " (since Linux 2.6.9)"
72 With this flag set, provide legacy virtual address space layout.
74 .BR ADDR_NO_RANDOMIZE " (since Linux 2.6.12)"
75 With this flag set, disable address-space-layout randomization.
77 .BR ADDR_LIMIT_32BIT " (since Linux 2.2)"
78 Limit the address space to 32 bits.
80 .BR ADDR_LIMIT_3GB " (since Linux 2.4.0)"
81 With this flag set, use 0xc0000000 as the offset at which to search
82 a virtual memory chunk on
84 otherwise use 0xffffe000.
86 .BR FDPIC_FUNCPTRS " (since Linux 2.6.11)"
87 User-space function pointers to signal handlers point
88 (on certain architectures) to descriptors.
90 .BR MMAP_PAGE_ZERO " (since Linux 2.4.0)"
91 Map page 0 as read-only
92 (to support binaries that depend on this SVr4 behavior).
94 .BR READ_IMPLIES_EXEC " (since Linux 2.6.8)"
102 .BR SHORT_INODE " (since Linux 2.4.0)"
105 .BR STICKY_TIMEOUTS " (since Linux 1.2.0)"
111 do not modify the returned timeout argument when
112 interrupted by a signal handler.
114 .BR UNAME26 " (since Linux 3.1)"
117 report a 2.6.40+ version number rather than a 3.x version number.
118 Added as a stopgap measure to support broken applications that
119 could not handle the kernel version-numbering switch from 2.6.x to 3.x.
121 .BR WHOLE_SECONDS " (since Linux 1.2.0)"
124 The available execution domains are:
126 .BR PER_BSD " (since Linux 1.2.0)"
129 .BR PER_HPUX " (since Linux 2.4)"
130 Support for 32-bit HP/UX.
131 This support was never complete, and was dropped so that since Linux 4.0,
132 this value has no effect.
134 .BR PER_IRIX32 " (since Linux 2.2)"
136 Never fully functional; support dropped in Linux 2.6.27.
138 .BR STICKY_TIMEOUTS .
140 .BR PER_IRIX64 " (since Linux 2.2)"
143 .BR STICKY_TIMEOUTS ;
144 otherwise no effects.
146 .BR PER_IRIXN32 " (since Linux 2.2)"
149 .BR STICKY_TIMEOUTS ;
150 otherwise no effects.
152 .BR PER_ISCR4 " (since Linux 1.2.0)"
154 .BR STICKY_TIMEOUTS ;
155 otherwise no effects.
157 .BR PER_LINUX " (since Linux 1.2.0)"
160 .BR PER_LINUX32 " (since Linux 2.2)"
163 .BR PER_LINUX32_3GB " (since Linux 2.4)"
167 .BR PER_LINUX_32BIT " (since Linux 2.0)"
169 .BR ADDR_LIMIT_32BIT .
171 .BR PER_LINUX_FDPIC " (since Linux 2.6.11)"
175 .BR PER_OSF4 " (since Linux 2.4)"
178 .\" Following is from a comment in arch/alpha/kernel/osf_sys.c
179 clear top 32 bits of iov_len in the user's buffer for
180 compatibility with old versions of OSF/1 where iov_len
184 .BR PER_OSR5 " (since Linux 2.4)"
189 otherwise no effects.
191 .BR PER_RISCOS " (since Linux 2.2)"
194 .BR PER_SCOSVR3 " (since Linux 1.2.0)"
196 .BR STICKY_TIMEOUTS ,
200 otherwise no effects.
202 .BR PER_SOLARIS " (since Linux 2.4)"
204 .BR STICKY_TIMEOUTS ;
205 otherwise no effects.
207 .BR PER_SUNOS " (since Linux 2.4.0)"
209 .BR STICKY_TIMEOUTS .
210 Divert library and dynamic linker searches to
212 Buggy, largely unmaintained, and almost entirely unused;
213 support was removed in Linux 2.6.26.
215 .BR PER_SVR3 " (since Linux 1.2.0)"
220 otherwise no effects.
222 .BR PER_SVR4 " (since Linux 1.2.0)"
227 otherwise no effects.
229 .BR PER_UW7 " (since Linux 2.4)"
234 otherwise no effects.
236 .BR PER_WYSEV386 " (since Linux 1.2.0)"
241 otherwise no effects.
243 .BR PER_XENIX " (since Linux 1.2.0)"
248 otherwise no effects.
250 On success, the previous
253 On error, \-1 is returned, and
255 is set appropriately.
259 The kernel was unable to change the personality.
261 This system call first appeared in Linux 1.1.20
262 (and thus first in a stable kernel release with Linux 1.2.0);
263 library support was added in glibc 2.3.
264 .\" personality wrapper first appeared in glibc 1.90,
265 .\" <sys/personality.h> was added later in 2.2.91.
268 is Linux-specific and should not be used in programs intended to