]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man/man2/personality.2
man/, share/mk/: Move man*/ to man/
[thirdparty/man-pages.git] / man / man2 / personality.2
CommitLineData
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.\"
4c1c5274 13.TH personality 2 (date) "Linux man-pages (unreleased)"
fea681da
MK
14.SH NAME
15personality \- set the process execution domain
21864090
AC
16.SH LIBRARY
17Standard C library
8fc3b2cf 18.RI ( libc ", " \-lc )
fea681da 19.SH SYNOPSIS
c7db92b9 20.nf
6891999e 21.B #include <sys/personality.h>
c6d039a3 22.P
6891999e 23.BI "int personality(unsigned long " persona );
c7db92b9 24.fi
fea681da
MK
25.SH DESCRIPTION
26Linux supports different execution domains, or personalities, for each
c13182ef
MK
27process.
28Among other things, execution domains tell Linux how to map
29signal numbers into signal actions.
30The execution domain system allows
fea681da 31Linux to provide limited support for binaries compiled under other
008f1ecc 32UNIX-like operating systems.
c6d039a3 33.P
7bd26577 34If
fea681da 35.I persona
7bd26577
MK
36is not
370xffffffff, then
38.BR personality ()
39sets the caller's execution domain to the value specified by
40.IR persona .
41Specifying
1ae6b2c7 42.I persona
7bd26577 43as 0xffffffff provides a way of retrieving
394a1f27 44the current persona without changing it.
c6d039a3 45.P
394a1f27
MK
46A list of the available execution domains can be found in
47.IR <sys/personality.h> .
2d41eca3
MK
48The execution domain is a 32-bit value in which the top three
49bytes are set aside for flags that cause the kernel to modify the
50behavior of certain system calls so as to emulate historical or
51architectural quirks.
923fda7a 52The least significant byte is a value defining the personality
2d41eca3
MK
53the kernel should assume.
54The flag values are as follows:
55.TP
56.BR ADDR_COMPAT_LAYOUT " (since Linux 2.6.9)"
57With this flag set, provide legacy virtual address space layout.
58.TP
59.BR ADDR_NO_RANDOMIZE " (since Linux 2.6.12)"
60With this flag set, disable address-space-layout randomization.
61.TP
62.BR ADDR_LIMIT_32BIT " (since Linux 2.2)"
63Limit the address space to 32 bits.
64.TP
65.BR ADDR_LIMIT_3GB " (since Linux 2.4.0)"
66With this flag set, use 0xc0000000 as the offset at which to search
67a virtual memory chunk on
68.BR mmap (2);
555c23c2 69otherwise use 0xffffe000.
4dd64901 70Applies to 32-bit x86 processes only.
2d41eca3
MK
71.TP
72.BR FDPIC_FUNCPTRS " (since Linux 2.6.11)"
73User-space function pointers to signal handlers point
4dd64901 74to descriptors.
75Applies only to ARM if BINFMT_ELF_FDPIC and SuperH.
2d41eca3
MK
76.TP
77.BR MMAP_PAGE_ZERO " (since Linux 2.4.0)"
78Map page 0 as read-only
79(to support binaries that depend on this SVr4 behavior).
80.TP
81.BR READ_IMPLIES_EXEC " (since Linux 2.6.8)"
82With this flag set,
1ae6b2c7 83.B PROT_READ
2d41eca3 84implies
1ae6b2c7 85.B PROT_EXEC
2d41eca3
MK
86for
87.BR mmap (2).
88.TP
89.BR SHORT_INODE " (since Linux 2.4.0)"
4dd64901 90No effect.
2d41eca3
MK
91.TP
92.BR STICKY_TIMEOUTS " (since Linux 1.2.0)"
93With this flag set,
94.BR select (2),
95.BR pselect (2),
96and
97.BR ppoll (2)
98do not modify the returned timeout argument when
99interrupted by a signal handler.
100.TP
101.BR UNAME26 " (since Linux 3.1)"
102Have
103.BR uname (2)
4dd64901 104report a 2.6.(40+x) version number rather than a MAJOR.x version number.
2d41eca3 105Added as a stopgap measure to support broken applications that
b324e17d
AC
106could not handle the
107kernel version-numbering switch from Linux 2.6.x to Linux 3.x.
2d41eca3
MK
108.TP
109.BR WHOLE_SECONDS " (since Linux 1.2.0)"
ad6913ad 110No effect.
c6d039a3 111.P
2d41eca3
MK
112The available execution domains are:
113.TP
114.BR PER_BSD " (since Linux 1.2.0)"
115BSD. (No effects.)
116.TP
117.BR PER_HPUX " (since Linux 2.4)"
118Support for 32-bit HP/UX.
119This support was never complete, and was dropped so that since Linux 4.0,
120this value has no effect.
121.TP
122.BR PER_IRIX32 " (since Linux 2.2)"
123IRIX 5 32-bit.
124Never fully functional; support dropped in Linux 2.6.27.
125Implies
126.BR STICKY_TIMEOUTS .
127.TP
128.BR PER_IRIX64 " (since Linux 2.2)"
129IRIX 6 64-bit.
130Implies
131.BR STICKY_TIMEOUTS ;
4dd64901 132otherwise no effect.
2d41eca3
MK
133.TP
134.BR PER_IRIXN32 " (since Linux 2.2)"
135IRIX 6 new 32-bit.
136Implies
137.BR STICKY_TIMEOUTS ;
4dd64901 138otherwise no effect.
2d41eca3
MK
139.TP
140.BR PER_ISCR4 " (since Linux 1.2.0)"
141Implies
142.BR STICKY_TIMEOUTS ;
4dd64901 143otherwise no effect.
2d41eca3
MK
144.TP
145.BR PER_LINUX " (since Linux 1.2.0)"
146Linux.
147.TP
148.BR PER_LINUX32 " (since Linux 2.2)"
4dd64901 149.BR uname (2)
150returns the name of the 32-bit architecture in the
151.I machine
152field ("i686" instead of "x86_64", &c.).
153.IP
154Under ia64 (Itanium), processes with this personality don't have the
155O_LARGEFILE
156.BR open (2)
157flag forced.
158.IP
159Under 64-bit ARM, setting this personality is forbidden if
160.BR execve (2)ing
161a 32-bit process would also be forbidden
162(cf. the allow_mismatched_32bit_el0 kernel parameter and
163.IR Documentation/arm64/asymmetric-32bit.rst ).
2d41eca3
MK
164.TP
165.BR PER_LINUX32_3GB " (since Linux 2.4)"
4dd64901 166Same as
167.BR PER_LINUX32 ,
168but implies
2d41eca3
MK
169.BR ADDR_LIMIT_3GB .
170.TP
171.BR PER_LINUX_32BIT " (since Linux 2.0)"
4dd64901 172Same as
173.BR PER_LINUX ,
174but implies
2d41eca3
MK
175.BR ADDR_LIMIT_32BIT .
176.TP
177.BR PER_LINUX_FDPIC " (since Linux 2.6.11)"
4dd64901 178Same as
179.BR PER_LINUX ,
180but implies
2d41eca3
MK
181.BR FDPIC_FUNCPTRS .
182.TP
183.BR PER_OSF4 " (since Linux 2.4)"
184OSF/1 v4.
4dd64901 185.\" commit 987f20a9dcce3989e48d87cff3952c095c994445
186No effect since Linux 6.1, which removed a.out binary support.
187Before, on alpha,
2d41eca3 188.\" Following is from a comment in arch/alpha/kernel/osf_sys.c
4dd64901 189would clear top 32 bits of iov_len in the user's buffer for
2d41eca3
MK
190compatibility with old versions of OSF/1 where iov_len
191was defined as.
192.IR int .
193.TP
194.BR PER_OSR5 " (since Linux 2.4)"
4dd64901 195SCO OpenServer 5.
2d41eca3 196Implies
1ae6b2c7 197.B STICKY_TIMEOUTS
2d41eca3
MK
198and
199.BR WHOLE_SECONDS ;
4dd64901 200otherwise no effect.
2d41eca3 201.TP
4dd64901 202.BR PER_RISCOS " (since Linux 2.3.7; macro since Linux 2.3.13)"
203Acorn RISC OS/Arthur (MIPS).
204No effect.
205.\" commit 125ec7b4e90cbae4eed5a7ff1ee479cc331dcf3c
206Up to Linux v4.0, would set the emulation altroot to
207.I /usr/gnemul/riscos
208(cf.\&
98c9ca4b 209.BR PER_SUNOS ,
4dd64901 210below).
211Before then, up to Linux 2.6.3, just Arthur emulation.
2d41eca3
MK
212.TP
213.BR PER_SCOSVR3 " (since Linux 1.2.0)"
4dd64901 214SCO UNIX System V Release 3.
215Same as
216.BR PER_OSR5 ,
217but also implies
218.BR SHORT_INODE .
2d41eca3
MK
219.TP
220.BR PER_SOLARIS " (since Linux 2.4)"
4dd64901 221Solaris.
2d41eca3
MK
222Implies
223.BR STICKY_TIMEOUTS ;
4dd64901 224otherwise no effect.
2d41eca3
MK
225.TP
226.BR PER_SUNOS " (since Linux 2.4.0)"
4dd64901 227Sun OS.
228Same as
229.BR PER_BSD ,
230but implies
2d41eca3 231.BR STICKY_TIMEOUTS .
4dd64901 232Prior to Linux 2.6.26,
233diverted library and dynamic linker searches to
2d41eca3 234.IR /usr/gnemul .
4dd64901 235Buggy, largely unmaintained, and almost entirely unused.
2d41eca3
MK
236.TP
237.BR PER_SVR3 " (since Linux 1.2.0)"
4dd64901 238AT&T UNIX System V Release 3.
2d41eca3 239Implies
1ae6b2c7 240.B STICKY_TIMEOUTS
2d41eca3
MK
241and
242.BR SHORT_INODE ;
4dd64901 243otherwise no effect.
2d41eca3
MK
244.TP
245.BR PER_SVR4 " (since Linux 1.2.0)"
4dd64901 246AT&T UNIX System V Release 4.
2d41eca3 247Implies
1ae6b2c7 248.B STICKY_TIMEOUTS
2d41eca3
MK
249and
250.BR MMAP_PAGE_ZERO ;
4dd64901 251otherwise no effect.
2d41eca3
MK
252.TP
253.BR PER_UW7 " (since Linux 2.4)"
4dd64901 254UnixWare 7.
2d41eca3 255Implies
1ae6b2c7 256.B STICKY_TIMEOUTS
2d41eca3
MK
257and
258.BR MMAP_PAGE_ZERO ;
4dd64901 259otherwise no effect.
2d41eca3
MK
260.TP
261.BR PER_WYSEV386 " (since Linux 1.2.0)"
4dd64901 262WYSE UNIX System V/386.
2d41eca3 263Implies
1ae6b2c7 264.B STICKY_TIMEOUTS
2d41eca3
MK
265and
266.BR SHORT_INODE ;
4dd64901 267otherwise no effect.
2d41eca3
MK
268.TP
269.BR PER_XENIX " (since Linux 1.2.0)"
4dd64901 270XENIX.
2d41eca3 271Implies
1ae6b2c7 272.B STICKY_TIMEOUTS
2d41eca3
MK
273and
274.BR SHORT_INODE ;
4dd64901 275otherwise no effect.
47297adb 276.SH RETURN VALUE
fea681da
MK
277On success, the previous
278.I persona
c13182ef
MK
279is returned.
280On error, \-1 is returned, and
fea681da 281.I errno
f6a4078b 282is set to indicate the error.
fea681da
MK
283.SH ERRORS
284.TP
285.B EINVAL
286The kernel was unable to change the personality.
4131356c
AC
287.SH STANDARDS
288Linux.
289.SH HISTORY
290Linux 1.1.20,
291.\" (and thus first in a stable kernel release with Linux 1.2.0)
292glibc 2.3.
ee25832b 293.\" personality wrapper first appeared in glibc 1.90,
b324e17d 294.\" <sys/personality.h> was added later in glibc 2.2.91.
fd4b3853
MK
295.SH SEE ALSO
296.BR setarch (8)