]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/personality.2
Many pages: Fix style issues reported by `make lint-groff`
[thirdparty/man-pages.git] / 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.\"
1d767b55 13.TH PERSONALITY 2 2021-03-22 "Linux" "Linux Programmer's Manual"
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>
68e4db0a 22.PP
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.
efeece04 33.PP
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.
efeece04 45.PP
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.
2d41eca3
MK
70.TP
71.BR FDPIC_FUNCPTRS " (since Linux 2.6.11)"
72User-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)"
76Map 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)"
80With this flag set,
1ae6b2c7 81.B PROT_READ
2d41eca3 82implies
1ae6b2c7 83.B PROT_EXEC
2d41eca3
MK
84for
85.BR mmap (2).
86.TP
87.BR SHORT_INODE " (since Linux 2.4.0)"
88No effects(?).
89.TP
90.BR STICKY_TIMEOUTS " (since Linux 1.2.0)"
91With this flag set,
92.BR select (2),
93.BR pselect (2),
94and
95.BR ppoll (2)
96do not modify the returned timeout argument when
97interrupted by a signal handler.
98.TP
99.BR UNAME26 " (since Linux 3.1)"
100Have
101.BR uname (2)
102report a 2.6.40+ version number rather than a 3.x version number.
103Added as a stopgap measure to support broken applications that
104could 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 107No effect.
2d41eca3
MK
108.PP
109The available execution domains are:
110.TP
111.BR PER_BSD " (since Linux 1.2.0)"
112BSD. (No effects.)
113.TP
114.BR PER_HPUX " (since Linux 2.4)"
115Support for 32-bit HP/UX.
116This support was never complete, and was dropped so that since Linux 4.0,
117this value has no effect.
118.TP
119.BR PER_IRIX32 " (since Linux 2.2)"
120IRIX 5 32-bit.
121Never fully functional; support dropped in Linux 2.6.27.
122Implies
123.BR STICKY_TIMEOUTS .
124.TP
125.BR PER_IRIX64 " (since Linux 2.2)"
126IRIX 6 64-bit.
127Implies
128.BR STICKY_TIMEOUTS ;
129otherwise no effects.
130.TP
131.BR PER_IRIXN32 " (since Linux 2.2)"
132IRIX 6 new 32-bit.
133Implies
134.BR STICKY_TIMEOUTS ;
135otherwise no effects.
136.TP
137.BR PER_ISCR4 " (since Linux 1.2.0)"
138Implies
139.BR STICKY_TIMEOUTS ;
140otherwise no effects.
141.TP
142.BR PER_LINUX " (since Linux 1.2.0)"
143Linux.
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)"
149Implies
150.BR ADDR_LIMIT_3GB .
151.TP
152.BR PER_LINUX_32BIT " (since Linux 2.0)"
153Implies
154.BR ADDR_LIMIT_32BIT .
155.TP
156.BR PER_LINUX_FDPIC " (since Linux 2.6.11)"
157Implies
158.BR FDPIC_FUNCPTRS .
159.TP
160.BR PER_OSF4 " (since Linux 2.4)"
161OSF/1 v4.
162On alpha,
163.\" Following is from a comment in arch/alpha/kernel/osf_sys.c
164clear top 32 bits of iov_len in the user's buffer for
165compatibility with old versions of OSF/1 where iov_len
166was defined as.
167.IR int .
168.TP
169.BR PER_OSR5 " (since Linux 2.4)"
170Implies
1ae6b2c7 171.B STICKY_TIMEOUTS
2d41eca3
MK
172and
173.BR WHOLE_SECONDS ;
174otherwise 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)"
180Implies
181.BR STICKY_TIMEOUTS ,
182.BR WHOLE_SECONDS ,
183and
184.BR SHORT_INODE ;
185otherwise no effects.
186.TP
187.BR PER_SOLARIS " (since Linux 2.4)"
188Implies
189.BR STICKY_TIMEOUTS ;
190otherwise no effects.
191.TP
192.BR PER_SUNOS " (since Linux 2.4.0)"
193Implies
194.BR STICKY_TIMEOUTS .
195Divert library and dynamic linker searches to
196.IR /usr/gnemul .
197Buggy, largely unmaintained, and almost entirely unused;
198support was removed in Linux 2.6.26.
199.TP
200.BR PER_SVR3 " (since Linux 1.2.0)"
201Implies
1ae6b2c7 202.B STICKY_TIMEOUTS
2d41eca3
MK
203and
204.BR SHORT_INODE ;
205otherwise no effects.
206.TP
207.BR PER_SVR4 " (since Linux 1.2.0)"
208Implies
1ae6b2c7 209.B STICKY_TIMEOUTS
2d41eca3
MK
210and
211.BR MMAP_PAGE_ZERO ;
212otherwise no effects.
213.TP
214.BR PER_UW7 " (since Linux 2.4)"
215Implies
1ae6b2c7 216.B STICKY_TIMEOUTS
2d41eca3
MK
217and
218.BR MMAP_PAGE_ZERO ;
219otherwise no effects.
220.TP
221.BR PER_WYSEV386 " (since Linux 1.2.0)"
222Implies
1ae6b2c7 223.B STICKY_TIMEOUTS
2d41eca3
MK
224and
225.BR SHORT_INODE ;
226otherwise no effects.
227.TP
228.BR PER_XENIX " (since Linux 1.2.0)"
229Implies
1ae6b2c7 230.B STICKY_TIMEOUTS
2d41eca3
MK
231and
232.BR SHORT_INODE ;
233otherwise no effects.
47297adb 234.SH RETURN VALUE
fea681da
MK
235On success, the previous
236.I persona
c13182ef
MK
237is returned.
238On error, \-1 is returned, and
fea681da 239.I errno
f6a4078b 240is set to indicate the error.
fea681da
MK
241.SH ERRORS
242.TP
243.B EINVAL
244The kernel was unable to change the personality.
ee25832b 245.SH VERSIONS
2d41eca3
MK
246This 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
248library 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 253is Linux-specific and should not be used in programs intended to
75b48e9d 254be portable.
fd4b3853
MK
255.SH SEE ALSO
256.BR setarch (8)