]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/personality.2
sched_setattr.2: tfix
[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.\"
93015253 4.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
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.
c13182ef 13.\"
fea681da
MK
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.
c13182ef 21.\"
fea681da
MK
22.\" Formatted or processed versions of this manual, if unaccompanied by
23.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 24.\" %%%LICENSE_END
fea681da
MK
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
e17d909d 31.\" Modified 2004-11-03 patch from Martin Schulze <joey@infodrom.org>
fea681da 32.\"
4b8c67d9 33.TH PERSONALITY 2 2017-09-15 "Linux" "Linux Programmer's Manual"
fea681da
MK
34.SH NAME
35personality \- set the process execution domain
36.SH SYNOPSIS
6891999e 37.B #include <sys/personality.h>
68e4db0a 38.PP
6891999e 39.BI "int personality(unsigned long " persona );
fea681da
MK
40.SH DESCRIPTION
41Linux supports different execution domains, or personalities, for each
c13182ef
MK
42process.
43Among other things, execution domains tell Linux how to map
44signal numbers into signal actions.
45The execution domain system allows
fea681da 46Linux to provide limited support for binaries compiled under other
008f1ecc 47UNIX-like operating systems.
efeece04 48.PP
7bd26577 49If
fea681da 50.I persona
7bd26577
MK
51is not
520xffffffff, then
53.BR personality ()
54sets the caller's execution domain to the value specified by
55.IR persona .
56Specifying
57.IR persona
58as 0xffffffff provides a way of retrieving
394a1f27 59the current persona without changing it.
efeece04 60.PP
394a1f27
MK
61A list of the available execution domains can be found in
62.IR <sys/personality.h> .
2d41eca3
MK
63The execution domain is a 32-bit value in which the top three
64bytes are set aside for flags that cause the kernel to modify the
65behavior of certain system calls so as to emulate historical or
66architectural quirks.
923fda7a 67The least significant byte is a value defining the personality
2d41eca3
MK
68the kernel should assume.
69The flag values are as follows:
70.TP
71.BR ADDR_COMPAT_LAYOUT " (since Linux 2.6.9)"
72With this flag set, provide legacy virtual address space layout.
73.TP
74.BR ADDR_NO_RANDOMIZE " (since Linux 2.6.12)"
75With this flag set, disable address-space-layout randomization.
76.TP
77.BR ADDR_LIMIT_32BIT " (since Linux 2.2)"
78Limit the address space to 32 bits.
79.TP
80.BR ADDR_LIMIT_3GB " (since Linux 2.4.0)"
81With this flag set, use 0xc0000000 as the offset at which to search
82a virtual memory chunk on
83.BR mmap (2);
555c23c2 84otherwise use 0xffffe000.
2d41eca3
MK
85.TP
86.BR FDPIC_FUNCPTRS " (since Linux 2.6.11)"
87User-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)"
91Map 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)"
95With this flag set,
96.BR PROT_READ
97implies
98.BR PROT_EXEC
99for
100.BR mmap (2).
101.TP
102.BR SHORT_INODE " (since Linux 2.4.0)"
103No effects(?).
104.TP
105.BR STICKY_TIMEOUTS " (since Linux 1.2.0)"
106With this flag set,
107.BR select (2),
108.BR pselect (2),
109and
110.BR ppoll (2)
111do not modify the returned timeout argument when
112interrupted by a signal handler.
113.TP
114.BR UNAME26 " (since Linux 3.1)"
115Have
116.BR uname (2)
117report a 2.6.40+ version number rather than a 3.x version number.
118Added as a stopgap measure to support broken applications that
119could 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)"
122No effects(?).
123.PP
124The available execution domains are:
125.TP
126.BR PER_BSD " (since Linux 1.2.0)"
127BSD. (No effects.)
128.TP
129.BR PER_HPUX " (since Linux 2.4)"
130Support for 32-bit HP/UX.
131This support was never complete, and was dropped so that since Linux 4.0,
132this value has no effect.
133.TP
134.BR PER_IRIX32 " (since Linux 2.2)"
135IRIX 5 32-bit.
136Never fully functional; support dropped in Linux 2.6.27.
137Implies
138.BR STICKY_TIMEOUTS .
139.TP
140.BR PER_IRIX64 " (since Linux 2.2)"
141IRIX 6 64-bit.
142Implies
143.BR STICKY_TIMEOUTS ;
144otherwise no effects.
145.TP
146.BR PER_IRIXN32 " (since Linux 2.2)"
147IRIX 6 new 32-bit.
148Implies
149.BR STICKY_TIMEOUTS ;
150otherwise no effects.
151.TP
152.BR PER_ISCR4 " (since Linux 1.2.0)"
153Implies
154.BR STICKY_TIMEOUTS ;
155otherwise no effects.
156.TP
157.BR PER_LINUX " (since Linux 1.2.0)"
158Linux.
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)"
164Implies
165.BR ADDR_LIMIT_3GB .
166.TP
167.BR PER_LINUX_32BIT " (since Linux 2.0)"
168Implies
169.BR ADDR_LIMIT_32BIT .
170.TP
171.BR PER_LINUX_FDPIC " (since Linux 2.6.11)"
172Implies
173.BR FDPIC_FUNCPTRS .
174.TP
175.BR PER_OSF4 " (since Linux 2.4)"
176OSF/1 v4.
177On alpha,
178.\" Following is from a comment in arch/alpha/kernel/osf_sys.c
179clear top 32 bits of iov_len in the user's buffer for
180compatibility with old versions of OSF/1 where iov_len
181was defined as.
182.IR int .
183.TP
184.BR PER_OSR5 " (since Linux 2.4)"
185Implies
186.BR STICKY_TIMEOUTS
187and
188.BR WHOLE_SECONDS ;
189otherwise 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)"
195Implies
196.BR STICKY_TIMEOUTS ,
197.BR WHOLE_SECONDS ,
198and
199.BR SHORT_INODE ;
200otherwise no effects.
201.TP
202.BR PER_SOLARIS " (since Linux 2.4)"
203Implies
204.BR STICKY_TIMEOUTS ;
205otherwise no effects.
206.TP
207.BR PER_SUNOS " (since Linux 2.4.0)"
208Implies
209.BR STICKY_TIMEOUTS .
210Divert library and dynamic linker searches to
211.IR /usr/gnemul .
212Buggy, largely unmaintained, and almost entirely unused;
213support was removed in Linux 2.6.26.
214.TP
215.BR PER_SVR3 " (since Linux 1.2.0)"
216Implies
217.BR STICKY_TIMEOUTS
218and
219.BR SHORT_INODE ;
220otherwise no effects.
221.TP
222.BR PER_SVR4 " (since Linux 1.2.0)"
223Implies
224.BR STICKY_TIMEOUTS
225and
226.BR MMAP_PAGE_ZERO ;
227otherwise no effects.
228.TP
229.BR PER_UW7 " (since Linux 2.4)"
230Implies
231.BR STICKY_TIMEOUTS
232and
233.BR MMAP_PAGE_ZERO ;
234otherwise no effects.
235.TP
236.BR PER_WYSEV386 " (since Linux 1.2.0)"
237Implies
238.BR STICKY_TIMEOUTS
239and
240.BR SHORT_INODE ;
241otherwise no effects.
242.TP
243.BR PER_XENIX " (since Linux 1.2.0)"
244Implies
245.BR STICKY_TIMEOUTS
246and
247.BR SHORT_INODE ;
248otherwise no effects.
47297adb 249.SH RETURN VALUE
fea681da
MK
250On success, the previous
251.I persona
c13182ef
MK
252is returned.
253On error, \-1 is returned, and
fea681da
MK
254.I errno
255is set appropriately.
256.SH ERRORS
257.TP
258.B EINVAL
259The kernel was unable to change the personality.
ee25832b 260.SH VERSIONS
2d41eca3
MK
261This system call first appeared in Linux 1.1.20
262(and thus first in a stable kernel release with Linux 1.2.0);
ee25832b
DL
263library 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.
47297adb 266.SH CONFORMING TO
e511ffb6 267.BR personality ()
8382f16d 268is Linux-specific and should not be used in programs intended to
75b48e9d 269be portable.
fd4b3853
MK
270.SH SEE ALSO
271.BR setarch (8)