uapi 0.2.8

Wrappers for OS APIs on UNIX-like platform
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
extern crate proc; // https://github.com/rust-lang/rust/issues/64450

#[cfg(target_os = "linux")]
mod wrapper {
    use proc::*;
    use uapi::*;

    #[test_if(root)]
    fn sethostname1() {
        unshare(c::CLONE_NEWUTS).unwrap();
        let name = b"hello world";
        sethostname(name).unwrap();
        assert_eq!(gethostname(&mut [0; 128][..]).unwrap().as_ustr(), &name[..]);
    }
}