]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/personality.2
sched_setattr.2: tfix
[thirdparty/man-pages.git] / man2 / personality.2
1 .\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
2 .\" and Copyright (C) 2016, Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
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.
8 .\"
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.
13 .\"
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
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .\" Created Sat Aug 21 1995 Thomas K. Dyas <tdyas@eden.rutgers.edu>
27 .\"
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>
32 .\"
33 .TH PERSONALITY 2 2017-09-15 "Linux" "Linux Programmer's Manual"
34 .SH NAME
35 personality \- set the process execution domain
36 .SH SYNOPSIS
37 .B #include <sys/personality.h>
38 .PP
39 .BI "int personality(unsigned long " persona );
40 .SH DESCRIPTION
41 Linux supports different execution domains, or personalities, for each
42 process.
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.
48 .PP
49 If
50 .I persona
51 is not
52 0xffffffff, then
53 .BR personality ()
54 sets the caller's execution domain to the value specified by
55 .IR persona .
56 Specifying
57 .IR persona
58 as 0xffffffff provides a way of retrieving
59 the current persona without changing it.
60 .PP
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
66 architectural quirks.
67 The least significant byte is a value defining the personality
68 the kernel should assume.
69 The flag values are as follows:
70 .TP
71 .BR ADDR_COMPAT_LAYOUT " (since Linux 2.6.9)"
72 With this flag set, provide legacy virtual address space layout.
73 .TP
74 .BR ADDR_NO_RANDOMIZE " (since Linux 2.6.12)"
75 With this flag set, disable address-space-layout randomization.
76 .TP
77 .BR ADDR_LIMIT_32BIT " (since Linux 2.2)"
78 Limit the address space to 32 bits.
79 .TP
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
83 .BR mmap (2);
84 otherwise use 0xffffe000.
85 .TP
86 .BR FDPIC_FUNCPTRS " (since Linux 2.6.11)"
87 User-space function pointers to signal handlers point
88 (on certain architectures) to descriptors.
89 .TP
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).
93 .TP
94 .BR READ_IMPLIES_EXEC " (since Linux 2.6.8)"
95 With this flag set,
96 .BR PROT_READ
97 implies
98 .BR PROT_EXEC
99 for
100 .BR mmap (2).
101 .TP
102 .BR SHORT_INODE " (since Linux 2.4.0)"
103 No effects(?).
104 .TP
105 .BR STICKY_TIMEOUTS " (since Linux 1.2.0)"
106 With this flag set,
107 .BR select (2),
108 .BR pselect (2),
109 and
110 .BR ppoll (2)
111 do not modify the returned timeout argument when
112 interrupted by a signal handler.
113 .TP
114 .BR UNAME26 " (since Linux 3.1)"
115 Have
116 .BR uname (2)
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.
120 .TP
121 .BR WHOLE_SECONDS " (since Linux 1.2.0)"
122 No effects(?).
123 .PP
124 The available execution domains are:
125 .TP
126 .BR PER_BSD " (since Linux 1.2.0)"
127 BSD. (No effects.)
128 .TP
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.
133 .TP
134 .BR PER_IRIX32 " (since Linux 2.2)"
135 IRIX 5 32-bit.
136 Never fully functional; support dropped in Linux 2.6.27.
137 Implies
138 .BR STICKY_TIMEOUTS .
139 .TP
140 .BR PER_IRIX64 " (since Linux 2.2)"
141 IRIX 6 64-bit.
142 Implies
143 .BR STICKY_TIMEOUTS ;
144 otherwise no effects.
145 .TP
146 .BR PER_IRIXN32 " (since Linux 2.2)"
147 IRIX 6 new 32-bit.
148 Implies
149 .BR STICKY_TIMEOUTS ;
150 otherwise no effects.
151 .TP
152 .BR PER_ISCR4 " (since Linux 1.2.0)"
153 Implies
154 .BR STICKY_TIMEOUTS ;
155 otherwise no effects.
156 .TP
157 .BR PER_LINUX " (since Linux 1.2.0)"
158 Linux.
159 .TP
160 .BR PER_LINUX32 " (since Linux 2.2)"
161 [To be documented.]
162 .TP
163 .BR PER_LINUX32_3GB " (since Linux 2.4)"
164 Implies
165 .BR ADDR_LIMIT_3GB .
166 .TP
167 .BR PER_LINUX_32BIT " (since Linux 2.0)"
168 Implies
169 .BR ADDR_LIMIT_32BIT .
170 .TP
171 .BR PER_LINUX_FDPIC " (since Linux 2.6.11)"
172 Implies
173 .BR FDPIC_FUNCPTRS .
174 .TP
175 .BR PER_OSF4 " (since Linux 2.4)"
176 OSF/1 v4.
177 On alpha,
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
181 was defined as.
182 .IR int .
183 .TP
184 .BR PER_OSR5 " (since Linux 2.4)"
185 Implies
186 .BR STICKY_TIMEOUTS
187 and
188 .BR WHOLE_SECONDS ;
189 otherwise no effects.
190 .TP
191 .BR PER_RISCOS " (since Linux 2.2)"
192 [To be documented.]
193 .TP
194 .BR PER_SCOSVR3 " (since Linux 1.2.0)"
195 Implies
196 .BR STICKY_TIMEOUTS ,
197 .BR WHOLE_SECONDS ,
198 and
199 .BR SHORT_INODE ;
200 otherwise no effects.
201 .TP
202 .BR PER_SOLARIS " (since Linux 2.4)"
203 Implies
204 .BR STICKY_TIMEOUTS ;
205 otherwise no effects.
206 .TP
207 .BR PER_SUNOS " (since Linux 2.4.0)"
208 Implies
209 .BR STICKY_TIMEOUTS .
210 Divert library and dynamic linker searches to
211 .IR /usr/gnemul .
212 Buggy, largely unmaintained, and almost entirely unused;
213 support was removed in Linux 2.6.26.
214 .TP
215 .BR PER_SVR3 " (since Linux 1.2.0)"
216 Implies
217 .BR STICKY_TIMEOUTS
218 and
219 .BR SHORT_INODE ;
220 otherwise no effects.
221 .TP
222 .BR PER_SVR4 " (since Linux 1.2.0)"
223 Implies
224 .BR STICKY_TIMEOUTS
225 and
226 .BR MMAP_PAGE_ZERO ;
227 otherwise no effects.
228 .TP
229 .BR PER_UW7 " (since Linux 2.4)"
230 Implies
231 .BR STICKY_TIMEOUTS
232 and
233 .BR MMAP_PAGE_ZERO ;
234 otherwise no effects.
235 .TP
236 .BR PER_WYSEV386 " (since Linux 1.2.0)"
237 Implies
238 .BR STICKY_TIMEOUTS
239 and
240 .BR SHORT_INODE ;
241 otherwise no effects.
242 .TP
243 .BR PER_XENIX " (since Linux 1.2.0)"
244 Implies
245 .BR STICKY_TIMEOUTS
246 and
247 .BR SHORT_INODE ;
248 otherwise no effects.
249 .SH RETURN VALUE
250 On success, the previous
251 .I persona
252 is returned.
253 On error, \-1 is returned, and
254 .I errno
255 is set appropriately.
256 .SH ERRORS
257 .TP
258 .B EINVAL
259 The kernel was unable to change the personality.
260 .SH VERSIONS
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.
266 .SH CONFORMING TO
267 .BR personality ()
268 is Linux-specific and should not be used in programs intended to
269 be portable.
270 .SH SEE ALSO
271 .BR setarch (8)