1 stable release

Uses old Rust 2015

1.0.0 Jan 14, 2017

#107 in #posix

Download history 546/week @ 2024-03-13 373/week @ 2024-03-20 248/week @ 2024-03-27 246/week @ 2024-04-03 422/week @ 2024-04-10 137/week @ 2024-04-17 104/week @ 2024-04-24 97/week @ 2024-05-01 127/week @ 2024-05-08 412/week @ 2024-05-15 1096/week @ 2024-05-22 620/week @ 2024-05-29 277/week @ 2024-06-05 239/week @ 2024-06-12 284/week @ 2024-06-19 159/week @ 2024-06-26

1,093 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

~185KB