1personality(2) System Calls Manual personality(2)
2
3
4
6 personality - set the process execution domain
7
9 Standard C library (libc, -lc)
10
12 #include <sys/personality.h>
13
14 int personality(unsigned long persona);
15
17 Linux supports different execution domains, or personalities, for each
18 process. Among other things, execution domains tell Linux how to map
19 signal numbers into signal actions. The execution domain system allows
20 Linux to provide limited support for binaries compiled under other
21 UNIX-like operating systems.
22
23 If persona is not 0xffffffff, then personality() sets the caller's exe‐
24 cution domain to the value specified by persona. Specifying persona as
25 0xffffffff provides a way of retrieving the current persona without
26 changing it.
27
28 A list of the available execution domains can be found in <sys/person‐
29 ality.h>. The execution domain is a 32-bit value in which the top
30 three bytes are set aside for flags that cause the kernel to modify the
31 behavior of certain system calls so as to emulate historical or archi‐
32 tectural quirks. The least significant byte is a value defining the
33 personality the kernel should assume. The flag values are as follows:
34
35 ADDR_COMPAT_LAYOUT (since Linux 2.6.9)
36 With this flag set, provide legacy virtual address space layout.
37
38 ADDR_NO_RANDOMIZE (since Linux 2.6.12)
39 With this flag set, disable address-space-layout randomization.
40
41 ADDR_LIMIT_32BIT (since Linux 2.2)
42 Limit the address space to 32 bits.
43
44 ADDR_LIMIT_3GB (since Linux 2.4.0)
45 With this flag set, use 0xc0000000 as the offset at which to
46 search a virtual memory chunk on mmap(2); otherwise use
47 0xffffe000.
48
49 FDPIC_FUNCPTRS (since Linux 2.6.11)
50 User-space function pointers to signal handlers point (on cer‐
51 tain architectures) to descriptors.
52
53 MMAP_PAGE_ZERO (since Linux 2.4.0)
54 Map page 0 as read-only (to support binaries that depend on this
55 SVr4 behavior).
56
57 READ_IMPLIES_EXEC (since Linux 2.6.8)
58 With this flag set, PROT_READ implies PROT_EXEC for mmap(2).
59
60 SHORT_INODE (since Linux 2.4.0)
61 No effects(?).
62
63 STICKY_TIMEOUTS (since Linux 1.2.0)
64 With this flag set, select(2), pselect(2), and ppoll(2) do not
65 modify the returned timeout argument when interrupted by a sig‐
66 nal handler.
67
68 UNAME26 (since Linux 3.1)
69 Have uname(2) report a 2.6.40+ version number rather than a 3.x
70 version number. Added as a stopgap measure to support broken
71 applications that could not handle the kernel version-numbering
72 switch from Linux 2.6.x to Linux 3.x.
73
74 WHOLE_SECONDS (since Linux 1.2.0)
75 No effect.
76
77 The available execution domains are:
78
79 PER_BSD (since Linux 1.2.0)
80 BSD. (No effects.)
81
82 PER_HPUX (since Linux 2.4)
83 Support for 32-bit HP/UX. This support was never complete, and
84 was dropped so that since Linux 4.0, this value has no effect.
85
86 PER_IRIX32 (since Linux 2.2)
87 IRIX 5 32-bit. Never fully functional; support dropped in Linux
88 2.6.27. Implies STICKY_TIMEOUTS.
89
90 PER_IRIX64 (since Linux 2.2)
91 IRIX 6 64-bit. Implies STICKY_TIMEOUTS; otherwise no effects.
92
93 PER_IRIXN32 (since Linux 2.2)
94 IRIX 6 new 32-bit. Implies STICKY_TIMEOUTS; otherwise no ef‐
95 fects.
96
97 PER_ISCR4 (since Linux 1.2.0)
98 Implies STICKY_TIMEOUTS; otherwise no effects.
99
100 PER_LINUX (since Linux 1.2.0)
101 Linux.
102
103 PER_LINUX32 (since Linux 2.2)
104 [To be documented.]
105
106 PER_LINUX32_3GB (since Linux 2.4)
107 Implies ADDR_LIMIT_3GB.
108
109 PER_LINUX_32BIT (since Linux 2.0)
110 Implies ADDR_LIMIT_32BIT.
111
112 PER_LINUX_FDPIC (since Linux 2.6.11)
113 Implies FDPIC_FUNCPTRS.
114
115 PER_OSF4 (since Linux 2.4)
116 OSF/1 v4. On alpha, clear top 32 bits of iov_len in the user's
117 buffer for compatibility with old versions of OSF/1 where
118 iov_len was defined as. int.
119
120 PER_OSR5 (since Linux 2.4)
121 Implies STICKY_TIMEOUTS and WHOLE_SECONDS; otherwise no effects.
122
123 PER_RISCOS (since Linux 2.2)
124 [To be documented.]
125
126 PER_SCOSVR3 (since Linux 1.2.0)
127 Implies STICKY_TIMEOUTS, WHOLE_SECONDS, and SHORT_INODE; other‐
128 wise no effects.
129
130 PER_SOLARIS (since Linux 2.4)
131 Implies STICKY_TIMEOUTS; otherwise no effects.
132
133 PER_SUNOS (since Linux 2.4.0)
134 Implies STICKY_TIMEOUTS. Divert library and dynamic linker
135 searches to /usr/gnemul. Buggy, largely unmaintained, and al‐
136 most entirely unused; support was removed in Linux 2.6.26.
137
138 PER_SVR3 (since Linux 1.2.0)
139 Implies STICKY_TIMEOUTS and SHORT_INODE; otherwise no effects.
140
141 PER_SVR4 (since Linux 1.2.0)
142 Implies STICKY_TIMEOUTS and MMAP_PAGE_ZERO; otherwise no ef‐
143 fects.
144
145 PER_UW7 (since Linux 2.4)
146 Implies STICKY_TIMEOUTS and MMAP_PAGE_ZERO; otherwise no ef‐
147 fects.
148
149 PER_WYSEV386 (since Linux 1.2.0)
150 Implies STICKY_TIMEOUTS and SHORT_INODE; otherwise no effects.
151
152 PER_XENIX (since Linux 1.2.0)
153 Implies STICKY_TIMEOUTS and SHORT_INODE; otherwise no effects.
154
156 On success, the previous persona is returned. On error, -1 is re‐
157 turned, and errno is set to indicate the error.
158
160 EINVAL The kernel was unable to change the personality.
161
163 Linux.
164
166 Linux 1.1.20, glibc 2.3.
167
169 setarch(8)
170
171
172
173Linux man-pages 6.04 2023-03-30 personality(2)