]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu> |
2d41eca3 | 2 | .\" and Copyright (C) 2016, Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da | 3 | .\" |
5fbde956 | 4 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da MK |
5 | .\" |
6 | .\" Created Sat Aug 21 1995 Thomas K. Dyas <tdyas@eden.rutgers.edu> | |
7 | .\" | |
8 | .\" typo corrected, aeb, 950825 | |
9 | .\" added layout change from joey, 960722 | |
10 | .\" changed prototype, documented 0xffffffff, aeb, 030101 | |
e17d909d | 11 | .\" Modified 2004-11-03 patch from Martin Schulze <joey@infodrom.org> |
fea681da | 12 | .\" |
1d767b55 | 13 | .TH PERSONALITY 2 2021-03-22 "Linux" "Linux Programmer's Manual" |
fea681da MK |
14 | .SH NAME |
15 | personality \- set the process execution domain | |
21864090 AC |
16 | .SH LIBRARY |
17 | Standard C library | |
8fc3b2cf | 18 | .RI ( libc ", " \-lc ) |
fea681da | 19 | .SH SYNOPSIS |
c7db92b9 | 20 | .nf |
6891999e | 21 | .B #include <sys/personality.h> |
68e4db0a | 22 | .PP |
6891999e | 23 | .BI "int personality(unsigned long " persona ); |
c7db92b9 | 24 | .fi |
fea681da MK |
25 | .SH DESCRIPTION |
26 | Linux supports different execution domains, or personalities, for each | |
c13182ef MK |
27 | process. |
28 | Among other things, execution domains tell Linux how to map | |
29 | signal numbers into signal actions. | |
30 | The execution domain system allows | |
fea681da | 31 | Linux to provide limited support for binaries compiled under other |
008f1ecc | 32 | UNIX-like operating systems. |
efeece04 | 33 | .PP |
7bd26577 | 34 | If |
fea681da | 35 | .I persona |
7bd26577 MK |
36 | is not |
37 | 0xffffffff, then | |
38 | .BR personality () | |
39 | sets the caller's execution domain to the value specified by | |
40 | .IR persona . | |
41 | Specifying | |
1ae6b2c7 | 42 | .I persona |
7bd26577 | 43 | as 0xffffffff provides a way of retrieving |
394a1f27 | 44 | the current persona without changing it. |
efeece04 | 45 | .PP |
394a1f27 MK |
46 | A list of the available execution domains can be found in |
47 | .IR <sys/personality.h> . | |
2d41eca3 MK |
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 | |
51 | architectural quirks. | |
923fda7a | 52 | The least significant byte is a value defining the personality |
2d41eca3 MK |
53 | the kernel should assume. |
54 | The flag values are as follows: | |
55 | .TP | |
56 | .BR ADDR_COMPAT_LAYOUT " (since Linux 2.6.9)" | |
57 | With this flag set, provide legacy virtual address space layout. | |
58 | .TP | |
59 | .BR ADDR_NO_RANDOMIZE " (since Linux 2.6.12)" | |
60 | With this flag set, disable address-space-layout randomization. | |
61 | .TP | |
62 | .BR ADDR_LIMIT_32BIT " (since Linux 2.2)" | |
63 | Limit the address space to 32 bits. | |
64 | .TP | |
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 | |
68 | .BR mmap (2); | |
555c23c2 | 69 | otherwise use 0xffffe000. |
2d41eca3 MK |
70 | .TP |
71 | .BR FDPIC_FUNCPTRS " (since Linux 2.6.11)" | |
72 | User-space function pointers to signal handlers point | |
73 | (on certain architectures) to descriptors. | |
74 | .TP | |
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). | |
78 | .TP | |
79 | .BR READ_IMPLIES_EXEC " (since Linux 2.6.8)" | |
80 | With this flag set, | |
1ae6b2c7 | 81 | .B PROT_READ |
2d41eca3 | 82 | implies |
1ae6b2c7 | 83 | .B PROT_EXEC |
2d41eca3 MK |
84 | for |
85 | .BR mmap (2). | |
86 | .TP | |
87 | .BR SHORT_INODE " (since Linux 2.4.0)" | |
88 | No effects(?). | |
89 | .TP | |
90 | .BR STICKY_TIMEOUTS " (since Linux 1.2.0)" | |
91 | With this flag set, | |
92 | .BR select (2), | |
93 | .BR pselect (2), | |
94 | and | |
95 | .BR ppoll (2) | |
96 | do not modify the returned timeout argument when | |
97 | interrupted by a signal handler. | |
98 | .TP | |
99 | .BR UNAME26 " (since Linux 3.1)" | |
100 | Have | |
101 | .BR uname (2) | |
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. | |
105 | .TP | |
106 | .BR WHOLE_SECONDS " (since Linux 1.2.0)" | |
ad6913ad | 107 | No effect. |
2d41eca3 MK |
108 | .PP |
109 | The available execution domains are: | |
110 | .TP | |
111 | .BR PER_BSD " (since Linux 1.2.0)" | |
112 | BSD. (No effects.) | |
113 | .TP | |
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. | |
118 | .TP | |
119 | .BR PER_IRIX32 " (since Linux 2.2)" | |
120 | IRIX 5 32-bit. | |
121 | Never fully functional; support dropped in Linux 2.6.27. | |
122 | Implies | |
123 | .BR STICKY_TIMEOUTS . | |
124 | .TP | |
125 | .BR PER_IRIX64 " (since Linux 2.2)" | |
126 | IRIX 6 64-bit. | |
127 | Implies | |
128 | .BR STICKY_TIMEOUTS ; | |
129 | otherwise no effects. | |
130 | .TP | |
131 | .BR PER_IRIXN32 " (since Linux 2.2)" | |
132 | IRIX 6 new 32-bit. | |
133 | Implies | |
134 | .BR STICKY_TIMEOUTS ; | |
135 | otherwise no effects. | |
136 | .TP | |
137 | .BR PER_ISCR4 " (since Linux 1.2.0)" | |
138 | Implies | |
139 | .BR STICKY_TIMEOUTS ; | |
140 | otherwise no effects. | |
141 | .TP | |
142 | .BR PER_LINUX " (since Linux 1.2.0)" | |
143 | Linux. | |
144 | .TP | |
145 | .BR PER_LINUX32 " (since Linux 2.2)" | |
146 | [To be documented.] | |
147 | .TP | |
148 | .BR PER_LINUX32_3GB " (since Linux 2.4)" | |
149 | Implies | |
150 | .BR ADDR_LIMIT_3GB . | |
151 | .TP | |
152 | .BR PER_LINUX_32BIT " (since Linux 2.0)" | |
153 | Implies | |
154 | .BR ADDR_LIMIT_32BIT . | |
155 | .TP | |
156 | .BR PER_LINUX_FDPIC " (since Linux 2.6.11)" | |
157 | Implies | |
158 | .BR FDPIC_FUNCPTRS . | |
159 | .TP | |
160 | .BR PER_OSF4 " (since Linux 2.4)" | |
161 | OSF/1 v4. | |
162 | On alpha, | |
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 | |
166 | was defined as. | |
167 | .IR int . | |
168 | .TP | |
169 | .BR PER_OSR5 " (since Linux 2.4)" | |
170 | Implies | |
1ae6b2c7 | 171 | .B STICKY_TIMEOUTS |
2d41eca3 MK |
172 | and |
173 | .BR WHOLE_SECONDS ; | |
174 | otherwise no effects. | |
175 | .TP | |
176 | .BR PER_RISCOS " (since Linux 2.2)" | |
177 | [To be documented.] | |
178 | .TP | |
179 | .BR PER_SCOSVR3 " (since Linux 1.2.0)" | |
180 | Implies | |
181 | .BR STICKY_TIMEOUTS , | |
182 | .BR WHOLE_SECONDS , | |
183 | and | |
184 | .BR SHORT_INODE ; | |
185 | otherwise no effects. | |
186 | .TP | |
187 | .BR PER_SOLARIS " (since Linux 2.4)" | |
188 | Implies | |
189 | .BR STICKY_TIMEOUTS ; | |
190 | otherwise no effects. | |
191 | .TP | |
192 | .BR PER_SUNOS " (since Linux 2.4.0)" | |
193 | Implies | |
194 | .BR STICKY_TIMEOUTS . | |
195 | Divert library and dynamic linker searches to | |
196 | .IR /usr/gnemul . | |
197 | Buggy, largely unmaintained, and almost entirely unused; | |
198 | support was removed in Linux 2.6.26. | |
199 | .TP | |
200 | .BR PER_SVR3 " (since Linux 1.2.0)" | |
201 | Implies | |
1ae6b2c7 | 202 | .B STICKY_TIMEOUTS |
2d41eca3 MK |
203 | and |
204 | .BR SHORT_INODE ; | |
205 | otherwise no effects. | |
206 | .TP | |
207 | .BR PER_SVR4 " (since Linux 1.2.0)" | |
208 | Implies | |
1ae6b2c7 | 209 | .B STICKY_TIMEOUTS |
2d41eca3 MK |
210 | and |
211 | .BR MMAP_PAGE_ZERO ; | |
212 | otherwise no effects. | |
213 | .TP | |
214 | .BR PER_UW7 " (since Linux 2.4)" | |
215 | Implies | |
1ae6b2c7 | 216 | .B STICKY_TIMEOUTS |
2d41eca3 MK |
217 | and |
218 | .BR MMAP_PAGE_ZERO ; | |
219 | otherwise no effects. | |
220 | .TP | |
221 | .BR PER_WYSEV386 " (since Linux 1.2.0)" | |
222 | Implies | |
1ae6b2c7 | 223 | .B STICKY_TIMEOUTS |
2d41eca3 MK |
224 | and |
225 | .BR SHORT_INODE ; | |
226 | otherwise no effects. | |
227 | .TP | |
228 | .BR PER_XENIX " (since Linux 1.2.0)" | |
229 | Implies | |
1ae6b2c7 | 230 | .B STICKY_TIMEOUTS |
2d41eca3 MK |
231 | and |
232 | .BR SHORT_INODE ; | |
233 | otherwise no effects. | |
47297adb | 234 | .SH RETURN VALUE |
fea681da MK |
235 | On success, the previous |
236 | .I persona | |
c13182ef MK |
237 | is returned. |
238 | On error, \-1 is returned, and | |
fea681da | 239 | .I errno |
f6a4078b | 240 | is set to indicate the error. |
fea681da MK |
241 | .SH ERRORS |
242 | .TP | |
243 | .B EINVAL | |
244 | The kernel was unable to change the personality. | |
ee25832b | 245 | .SH VERSIONS |
2d41eca3 MK |
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); | |
ee25832b DL |
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. | |
47297adb | 251 | .SH CONFORMING TO |
e511ffb6 | 252 | .BR personality () |
8382f16d | 253 | is Linux-specific and should not be used in programs intended to |
75b48e9d | 254 | be portable. |
fd4b3853 MK |
255 | .SH SEE ALSO |
256 | .BR setarch (8) |