#linux #posix #ffi #personality

linux-personality

Wrapper around Linux personality function

1 stable release

Uses old Rust 2015

1.0.0 Jan 14, 2017

#70 in #posix

Download history 199/week @ 2023-11-20 168/week @ 2023-11-27 255/week @ 2023-12-04 154/week @ 2023-12-11 151/week @ 2023-12-18 27/week @ 2023-12-25 58/week @ 2024-01-01 49/week @ 2024-01-08 82/week @ 2024-01-15 211/week @ 2024-01-22 105/week @ 2024-01-29 136/week @ 2024-02-05 89/week @ 2024-02-12 106/week @ 2024-02-19 286/week @ 2024-02-26 245/week @ 2024-03-04

731 downloads per month
Used in 2 crates

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

~175KB