2 stable releases

Uses old Rust 2015

2.0.0 Oct 4, 2024
1.0.0 Jan 14, 2017

#175 in Unix APIs

Download history 125/week @ 2024-08-21 97/week @ 2024-08-28 128/week @ 2024-09-04 1315/week @ 2024-09-11 462/week @ 2024-09-18 499/week @ 2024-09-25 696/week @ 2024-10-02 627/week @ 2024-10-09 449/week @ 2024-10-16 343/week @ 2024-10-23 164/week @ 2024-10-30 154/week @ 2024-11-06 118/week @ 2024-11-13 130/week @ 2024-11-20 283/week @ 2024-11-27 133/week @ 2024-12-04

688 downloads per month
Used in 3 crates (2 directly)

MIT license

10KB
71 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::Personality;

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

This gets the personality.

extern crate linux_personality;
use linux_personality::get_personality;

let persona = get_personality().unwrap();

Dependencies

~145KB