Crate linux_personality [] [src]

linux-personality

This crate is a type safe wrapper around Linux personality function.

Examples

This sets the personality.

extern crate linux_personality;
use linux_personality::personality;
use linux_personality::PER_LINUX;

let previous_personality = personality(PER_LINUX).unwrap();

This gets the personality.

extern crate linux_personality;
use linux_personality::get_personality;

let persona = get_personality().unwrap();

Modules

ffi

Contains FFI function declarations.

Structs

Personality

Constants

ADDR_COMPAT_LAYOUT

With this flag set, provide legacy virtual address space layout.

ADDR_LIMIT_32BIT

Limit the address space to 32 bits.

ADDR_LIMIT_3GB

With this flag set, use 0xC0000000 as the offset at which to search a virtual memory chunk on mmap(2); otherwise use 0xFFFFE000.

ADDR_NO_RANDOMIZE

With this flag set, disable address-space-layout randomization.

FDPIC_FUNCPTRS

User-space function pointers to signal handlers point (on certain architectures) to descriptors.

MMAP_PAGE_ZERO

Map page 0 as read-only (to support binaries that depend on this SVr4 behavior).

PER_BSD

BSD. (No effects.)

PER_HPUX

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.

PER_IRIX32

IRIX 5 32-bit. Never fully functional; support dropped in Linux 2.6.27. Implies STICKY_TIMEOUTS.

PER_IRIX64

IRIX 6 64-bit. Implies STICKY_TIMEOUTS; otherwise no effects.

PER_IRIXN32

IRIX 6 new 32-bit. Implies STICKY_TIMEOUTS; otherwise no effects.

PER_ISCR4

Implies STICKY_TIMEOUTS; otherwise no effects.

PER_LINUX

Linux

PER_LINUX32

[To be documented.]

PER_LINUX32_3GB

Implies ADDR_LIMIT_3GB.

PER_LINUX_32BIT

Implies ADDR_LIMIT_32BIT.

PER_LINUX_FDPIC

Implies FDPIC_FUNCPTRS.

PER_MASK

[to be documented]

PER_OSF4

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. int.

PER_OSR5

Implies STICKY_TIMEOUTS and WHOLE_SECONDS; otherwise no effects.

PER_RISCOS

[To be documented.]

PER_SCOSVR3

Implies STICKY_TIMEOUTS, WHOLE_SECONDS, and SHORT_INODE; otherwise no effects.

PER_SOLARIS

Implies STICKY_TIMEOUTS; otherwise no effects.

PER_SUNOS

Implies STICKY_TIMEOUTS. Divert library and dynamic linker searches to /usr/gnemul. Buggy, largely unmaintained, and almost entirely unused; support was removed in Linux 2.6.26.

PER_SVR3

Implies STICKY_TIMEOUTS and SHORT_INODE; otherwise no effects.

PER_SVR4

Implies STICKY_TIMEOUTS and MMAP_PAGE_ZERO; otherwise no effects.

PER_UW7

Implies STICKY_TIMEOUTS and MMAP_PAGE_ZERO; otherwise no effects.

PER_WYSEV386

Implies STICKY_TIMEOUTS and SHORT_INODE; otherwise no effects.

PER_XENIX

Implies STICKY_TIMEOUTS and SHORT_INODE; otherwise no effects.

READ_IMPLIES_EXEC

With this flag set, PROT_READ implies PROT_EXEC for mmap(2).

SHORT_INODE

No effects(?).

STICKY_TIMEOUTS

With this flag set, select(2), pselect(2), and ppoll(2) do not modify the returned timeout argument when interrupted by a signal handler.

UNAME26

Have uname(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.

WHOLE_SECONDS

No effects(?).

Functions

get_personality

This function only gets the current persona.

personality

Set the process domain execution model.