386 lines
8.0 KiB
HTML
386 lines
8.0 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of PERSONALITY</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>PERSONALITY</H1>
|
|
Section: Linux Programmer's Manual (2)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
personality - set the process execution domain
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>#include <<A HREF="file:///usr/include/sys/personality.h">sys/personality.h</A>></B>
|
|
|
|
<P>
|
|
|
|
<B>int personality(unsigned long </B><I>persona</I><B>);</B>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
Linux supports different execution domains, or personalities, for each
|
|
process.
|
|
Among other things, execution domains tell Linux how to map
|
|
signal numbers into signal actions.
|
|
The execution domain system allows
|
|
Linux to provide limited support for binaries compiled under other
|
|
UNIX-like operating systems.
|
|
<P>
|
|
|
|
If
|
|
<I>persona</I>
|
|
|
|
is not
|
|
0xffffffff, then
|
|
<B>personality</B>()
|
|
|
|
sets the caller's execution domain to the value specified by
|
|
<I>persona</I>.
|
|
|
|
Specifying
|
|
<I>persona</I>
|
|
|
|
as 0xffffffff provides a way of retrieving
|
|
the current persona without changing it.
|
|
<P>
|
|
|
|
A list of the available execution domains can be found in
|
|
<I><<A HREF="file:///usr/include/sys/personality.h">sys/personality.h</A>></I>.
|
|
|
|
The execution domain is a 32-bit value in which the top three
|
|
bytes are set aside for flags that cause the kernel to modify the
|
|
behavior of certain system calls so as to emulate historical or
|
|
architectural quirks.
|
|
The least significant byte is value defining the personality
|
|
the kernel should assume.
|
|
The flag values are as follows:
|
|
<DL COMPACT>
|
|
<DT id="1"><B>ADDR_COMPAT_LAYOUT</B> (since Linux 2.6.9)
|
|
|
|
<DD>
|
|
With this flag set, provide legacy virtual address space layout.
|
|
<DT id="2"><B>ADDR_NO_RANDOMIZE</B> (since Linux 2.6.12)
|
|
|
|
<DD>
|
|
With this flag set, disable address-space-layout randomization.
|
|
<DT id="3"><B>ADDR_LIMIT_32BIT</B> (since Linux 2.2)
|
|
|
|
<DD>
|
|
Limit the address space to 32 bits.
|
|
<DT id="4"><B>ADDR_LIMIT_3GB</B> (since Linux 2.4.0)
|
|
|
|
<DD>
|
|
With this flag set, use 0xc0000000 as the offset at which to search
|
|
a virtual memory chunk on
|
|
<B><A HREF="/cgi-bin/man/man2html?2+mmap">mmap</A></B>(2);
|
|
|
|
otherwise use 0xffffe000.
|
|
<DT id="5"><B>FDPIC_FUNCPTRS</B> (since Linux 2.6.11)
|
|
|
|
<DD>
|
|
User-space function pointers to signal handlers point
|
|
(on certain architectures) to descriptors.
|
|
<DT id="6"><B>MMAP_PAGE_ZERO</B> (since Linux 2.4.0)
|
|
|
|
<DD>
|
|
Map page 0 as read-only
|
|
(to support binaries that depend on this SVr4 behavior).
|
|
<DT id="7"><B>READ_IMPLIES_EXEC</B> (since Linux 2.6.8)
|
|
|
|
<DD>
|
|
With this flag set,
|
|
<B>PROT_READ</B>
|
|
|
|
implies
|
|
<B>PROT_EXEC</B>
|
|
|
|
for
|
|
<B><A HREF="/cgi-bin/man/man2html?2+mmap">mmap</A></B>(2).
|
|
|
|
<DT id="8"><B>SHORT_INODE</B> (since Linux 2.4.0)
|
|
|
|
<DD>
|
|
No effects(?).
|
|
<DT id="9"><B>STICKY_TIMEOUTS</B> (since Linux 1.2.0)
|
|
|
|
<DD>
|
|
With this flag set,
|
|
<B><A HREF="/cgi-bin/man/man2html?2+select">select</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+pselect">pselect</A></B>(2),
|
|
|
|
and
|
|
<B><A HREF="/cgi-bin/man/man2html?2+ppoll">ppoll</A></B>(2)
|
|
|
|
do not modify the returned timeout argument when
|
|
interrupted by a signal handler.
|
|
<DT id="10"><B>UNAME26</B> (since Linux 3.1)
|
|
|
|
<DD>
|
|
Have
|
|
<B><A HREF="/cgi-bin/man/man2html?2+uname">uname</A></B>(2)
|
|
|
|
report a 2.6.40+ version number rather than a 3.x version number.
|
|
Added as a stopgap measure to support broken applications that
|
|
could not handle the kernel version-numbering switch from 2.6.x to 3.x.
|
|
<DT id="11"><B>WHOLE_SECONDS</B> (since Linux 1.2.0)
|
|
|
|
<DD>
|
|
No effects(?).
|
|
</DL>
|
|
<P>
|
|
|
|
The available execution domains are:
|
|
<DL COMPACT>
|
|
<DT id="12"><B>PER_BSD</B> (since Linux 1.2.0)
|
|
|
|
<DD>
|
|
BSD. (No effects.)
|
|
<DT id="13"><B>PER_HPUX</B> (since Linux 2.4)
|
|
|
|
<DD>
|
|
Support for 32-bit HP/UX.
|
|
This support was never complete, and was dropped so that since Linux 4.0,
|
|
this value has no effect.
|
|
<DT id="14"><B>PER_IRIX32</B> (since Linux 2.2)
|
|
|
|
<DD>
|
|
IRIX 5 32-bit.
|
|
Never fully functional; support dropped in Linux 2.6.27.
|
|
Implies
|
|
<B>STICKY_TIMEOUTS</B>.
|
|
|
|
<DT id="15"><B>PER_IRIX64</B> (since Linux 2.2)
|
|
|
|
<DD>
|
|
IRIX 6 64-bit.
|
|
Implies
|
|
<B>STICKY_TIMEOUTS</B>;
|
|
|
|
otherwise no effects.
|
|
<DT id="16"><B>PER_IRIXN32</B> (since Linux 2.2)
|
|
|
|
<DD>
|
|
IRIX 6 new 32-bit.
|
|
Implies
|
|
<B>STICKY_TIMEOUTS</B>;
|
|
|
|
otherwise no effects.
|
|
<DT id="17"><B>PER_ISCR4</B> (since Linux 1.2.0)
|
|
|
|
<DD>
|
|
Implies
|
|
<B>STICKY_TIMEOUTS</B>;
|
|
|
|
otherwise no effects.
|
|
<DT id="18"><B>PER_LINUX</B> (since Linux 1.2.0)
|
|
|
|
<DD>
|
|
Linux.
|
|
<DT id="19"><B>PER_LINUX32</B> (since Linux 2.2)
|
|
|
|
<DD>
|
|
[To be documented.]
|
|
<DT id="20"><B>PER_LINUX32_3GB</B> (since Linux 2.4)
|
|
|
|
<DD>
|
|
Implies
|
|
<B>ADDR_LIMIT_3GB</B>.
|
|
|
|
<DT id="21"><B>PER_LINUX_32BIT</B> (since Linux 2.0)
|
|
|
|
<DD>
|
|
Implies
|
|
<B>ADDR_LIMIT_32BIT</B>.
|
|
|
|
<DT id="22"><B>PER_LINUX_FDPIC</B> (since Linux 2.6.11)
|
|
|
|
<DD>
|
|
Implies
|
|
<B>FDPIC_FUNCPTRS</B>.
|
|
|
|
<DT id="23"><B>PER_OSF4</B> (since Linux 2.4)
|
|
|
|
<DD>
|
|
OSF/1 v4.
|
|
On alpha,
|
|
|
|
clear top 32 bits of iov_len in the user's buffer for
|
|
compatibility with old versions of OSF/1 where iov_len
|
|
was defined as.
|
|
<I>int</I>.
|
|
|
|
<DT id="24"><B>PER_OSR5</B> (since Linux 2.4)
|
|
|
|
<DD>
|
|
Implies
|
|
<B>STICKY_TIMEOUTS</B>
|
|
|
|
and
|
|
<B>WHOLE_SECONDS</B>;
|
|
|
|
otherwise no effects.
|
|
<DT id="25"><B>PER_RISCOS</B> (since Linux 2.2)
|
|
|
|
<DD>
|
|
[To be documented.]
|
|
<DT id="26"><B>PER_SCOSVR3</B> (since Linux 1.2.0)
|
|
|
|
<DD>
|
|
Implies
|
|
<B>STICKY_TIMEOUTS</B>,
|
|
|
|
<B>WHOLE_SECONDS</B>,
|
|
|
|
and
|
|
<B>SHORT_INODE</B>;
|
|
|
|
otherwise no effects.
|
|
<DT id="27"><B>PER_SOLARIS</B> (since Linux 2.4)
|
|
|
|
<DD>
|
|
Implies
|
|
<B>STICKY_TIMEOUTS</B>;
|
|
|
|
otherwise no effects.
|
|
<DT id="28"><B>PER_SUNOS</B> (since Linux 2.4.0)
|
|
|
|
<DD>
|
|
Implies
|
|
<B>STICKY_TIMEOUTS</B>.
|
|
|
|
Divert library and dynamic linker searches to
|
|
<I>/usr/gnemul</I>.
|
|
|
|
Buggy, largely unmaintained, and almost entirely unused;
|
|
support was removed in Linux 2.6.26.
|
|
<DT id="29"><B>PER_SVR3</B> (since Linux 1.2.0)
|
|
|
|
<DD>
|
|
Implies
|
|
<B>STICKY_TIMEOUTS</B>
|
|
|
|
and
|
|
<B>SHORT_INODE</B>;
|
|
|
|
otherwise no effects.
|
|
<DT id="30"><B>PER_SVR4</B> (since Linux 1.2.0)
|
|
|
|
<DD>
|
|
Implies
|
|
<B>STICKY_TIMEOUTS</B>
|
|
|
|
and
|
|
<B>MMAP_PAGE_ZERO</B>;
|
|
|
|
otherwise no effects.
|
|
<DT id="31"><B>PER_UW7</B> (since Linux 2.4)
|
|
|
|
<DD>
|
|
Implies
|
|
<B>STICKY_TIMEOUTS</B>
|
|
|
|
and
|
|
<B>MMAP_PAGE_ZERO</B>;
|
|
|
|
otherwise no effects.
|
|
<DT id="32"><B>PER_WYSEV386</B> (since Linux 1.2.0)
|
|
|
|
<DD>
|
|
Implies
|
|
<B>STICKY_TIMEOUTS</B>
|
|
|
|
and
|
|
<B>SHORT_INODE</B>;
|
|
|
|
otherwise no effects.
|
|
<DT id="33"><B>PER_XENIX</B> (since Linux 1.2.0)
|
|
|
|
<DD>
|
|
Implies
|
|
<B>STICKY_TIMEOUTS</B>
|
|
|
|
and
|
|
<B>SHORT_INODE</B>;
|
|
|
|
otherwise no effects.
|
|
</DL>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
On success, the previous
|
|
<I>persona</I>
|
|
|
|
is returned.
|
|
On error, -1 is returned, and
|
|
<I>errno</I>
|
|
|
|
is set appropriately.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>ERRORS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="34"><B>EINVAL</B>
|
|
|
|
<DD>
|
|
The kernel was unable to change the personality.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>VERSIONS</H2>
|
|
|
|
This system call first appeared in Linux 1.1.20
|
|
(and thus first in a stable kernel release with Linux 1.2.0);
|
|
library support was added in glibc 2.3.
|
|
|
|
|
|
<A NAME="lbAH"> </A>
|
|
<H2>CONFORMING TO</H2>
|
|
|
|
<B>personality</B>()
|
|
|
|
is Linux-specific and should not be used in programs intended to
|
|
be portable.
|
|
<A NAME="lbAI"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+setarch">setarch</A></B>(8)
|
|
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>COLOPHON</H2>
|
|
|
|
This page is part of release 5.05 of the Linux
|
|
<I>man-pages</I>
|
|
|
|
project.
|
|
A description of the project,
|
|
information about reporting bugs,
|
|
and the latest version of this page,
|
|
can be found at
|
|
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="35"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="36"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="37"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="38"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DT id="39"><A HREF="#lbAF">ERRORS</A><DD>
|
|
<DT id="40"><A HREF="#lbAG">VERSIONS</A><DD>
|
|
<DT id="41"><A HREF="#lbAH">CONFORMING TO</A><DD>
|
|
<DT id="42"><A HREF="#lbAI">SEE ALSO</A><DD>
|
|
<DT id="43"><A HREF="#lbAJ">COLOPHON</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:33 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|