1 .\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
2 .\" and Copyright (C) 2016, Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\" Created Sat Aug 21 1995 Thomas K. Dyas <tdyas@eden.rutgers.edu>
8 .\" typo corrected, aeb, 950825
9 .\" added layout change from joey, 960722
10 .\" changed prototype, documented 0xffffffff, aeb, 030101
11 .\" Modified 2004-11-03 patch from Martin Schulze <joey@infodrom.org>
13 .TH PERSONALITY 2 2022-09-09 "Linux man-pages (unreleased)"
15 personality \- set the process execution domain
18 .RI ( libc ", " \-lc )
21 .B #include <sys/personality.h>
23 .BI "int personality(unsigned long " persona );
26 Linux supports different execution domains, or personalities, for each
28 Among other things, execution domains tell Linux how to map
29 signal numbers into signal actions.
30 The execution domain system allows
31 Linux to provide limited support for binaries compiled under other
32 UNIX-like operating systems.
39 sets the caller's execution domain to the value specified by
43 as 0xffffffff provides a way of retrieving
44 the current persona without changing it.
46 A list of the available execution domains can be found in
47 .IR <sys/personality.h> .
48 The execution domain is a 32-bit value in which the top three
49 bytes are set aside for flags that cause the kernel to modify the
50 behavior of certain system calls so as to emulate historical or
52 The least significant byte is a value defining the personality
53 the kernel should assume.
54 The flag values are as follows:
56 .BR ADDR_COMPAT_LAYOUT " (since Linux 2.6.9)"
57 With this flag set, provide legacy virtual address space layout.
59 .BR ADDR_NO_RANDOMIZE " (since Linux 2.6.12)"
60 With this flag set, disable address-space-layout randomization.
62 .BR ADDR_LIMIT_32BIT " (since Linux 2.2)"
63 Limit the address space to 32 bits.
65 .BR ADDR_LIMIT_3GB " (since Linux 2.4.0)"
66 With this flag set, use 0xc0000000 as the offset at which to search
67 a virtual memory chunk on
69 otherwise use 0xffffe000.
71 .BR FDPIC_FUNCPTRS " (since Linux 2.6.11)"
72 User-space function pointers to signal handlers point
73 (on certain architectures) to descriptors.
75 .BR MMAP_PAGE_ZERO " (since Linux 2.4.0)"
76 Map page 0 as read-only
77 (to support binaries that depend on this SVr4 behavior).
79 .BR READ_IMPLIES_EXEC " (since Linux 2.6.8)"
87 .BR SHORT_INODE " (since Linux 2.4.0)"
90 .BR STICKY_TIMEOUTS " (since Linux 1.2.0)"
96 do not modify the returned timeout argument when
97 interrupted by a signal handler.
99 .BR UNAME26 " (since Linux 3.1)"
102 report a 2.6.40+ version number rather than a 3.x version number.
103 Added as a stopgap measure to support broken applications that
104 could not handle the kernel version-numbering switch from 2.6.x to 3.x.
106 .BR WHOLE_SECONDS " (since Linux 1.2.0)"
109 The available execution domains are:
111 .BR PER_BSD " (since Linux 1.2.0)"
114 .BR PER_HPUX " (since Linux 2.4)"
115 Support for 32-bit HP/UX.
116 This support was never complete, and was dropped so that since Linux 4.0,
117 this value has no effect.
119 .BR PER_IRIX32 " (since Linux 2.2)"
121 Never fully functional; support dropped in Linux 2.6.27.
123 .BR STICKY_TIMEOUTS .
125 .BR PER_IRIX64 " (since Linux 2.2)"
128 .BR STICKY_TIMEOUTS ;
129 otherwise no effects.
131 .BR PER_IRIXN32 " (since Linux 2.2)"
134 .BR STICKY_TIMEOUTS ;
135 otherwise no effects.
137 .BR PER_ISCR4 " (since Linux 1.2.0)"
139 .BR STICKY_TIMEOUTS ;
140 otherwise no effects.
142 .BR PER_LINUX " (since Linux 1.2.0)"
145 .BR PER_LINUX32 " (since Linux 2.2)"
148 .BR PER_LINUX32_3GB " (since Linux 2.4)"
152 .BR PER_LINUX_32BIT " (since Linux 2.0)"
154 .BR ADDR_LIMIT_32BIT .
156 .BR PER_LINUX_FDPIC " (since Linux 2.6.11)"
160 .BR PER_OSF4 " (since Linux 2.4)"
163 .\" Following is from a comment in arch/alpha/kernel/osf_sys.c
164 clear top 32 bits of iov_len in the user's buffer for
165 compatibility with old versions of OSF/1 where iov_len
169 .BR PER_OSR5 " (since Linux 2.4)"
174 otherwise no effects.
176 .BR PER_RISCOS " (since Linux 2.2)"
179 .BR PER_SCOSVR3 " (since Linux 1.2.0)"
181 .BR STICKY_TIMEOUTS ,
185 otherwise no effects.
187 .BR PER_SOLARIS " (since Linux 2.4)"
189 .BR STICKY_TIMEOUTS ;
190 otherwise no effects.
192 .BR PER_SUNOS " (since Linux 2.4.0)"
194 .BR STICKY_TIMEOUTS .
195 Divert library and dynamic linker searches to
197 Buggy, largely unmaintained, and almost entirely unused;
198 support was removed in Linux 2.6.26.
200 .BR PER_SVR3 " (since Linux 1.2.0)"
205 otherwise no effects.
207 .BR PER_SVR4 " (since Linux 1.2.0)"
212 otherwise no effects.
214 .BR PER_UW7 " (since Linux 2.4)"
219 otherwise no effects.
221 .BR PER_WYSEV386 " (since Linux 1.2.0)"
226 otherwise no effects.
228 .BR PER_XENIX " (since Linux 1.2.0)"
233 otherwise no effects.
235 On success, the previous
238 On error, \-1 is returned, and
240 is set to indicate the error.
244 The kernel was unable to change the personality.
246 This system call first appeared in Linux 1.1.20
247 (and thus first in a stable kernel release with Linux 1.2.0);
248 library support was added in glibc 2.3.
249 .\" personality wrapper first appeared in glibc 1.90,
250 .\" <sys/personality.h> was added later in 2.2.91.
253 is Linux-specific and should not be used in programs intended to