#linux #posix #ffi #personality

linux-personality

Wrapper around Linux personality function

1 stable release

Uses old Rust 2015

1.0.0 Jan 14, 2017

#28 in #posix

Download history 18/week @ 2021-04-02 16/week @ 2021-04-09 22/week @ 2021-04-16 39/week @ 2021-04-23 21/week @ 2021-04-30 13/week @ 2021-05-07 11/week @ 2021-05-14 3/week @ 2021-05-21 12/week @ 2021-05-28 12/week @ 2021-06-04 8/week @ 2021-06-11 12/week @ 2021-06-18 19/week @ 2021-06-25 11/week @ 2021-07-02 16/week @ 2021-07-09 33/week @ 2021-07-16

101 downloads per month

MIT license

9KB
76 lines

linux-personality

This crate intends to be a safe wrapper for the personality linux function.

Usage

First add this to your Cargo.toml:

[dependencies]
linux-personality = "1.0"

And this to your crate root:

extern crate linux_personality;

Example

extern crate linux_personality;

use linux_personality::get_personality();

fn main() {
    let persona = get_personality().unwrap();

    println!("Current personality: {:?}", persona);
}

Authors

Jean Pierre Dudey - Initial work - jeandudey@hotmail.com

License

This project is licensed under the MIT License. For more information see the LICENSE file on this repository.


lib.rs:

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();

Dependencies

~75KB