uapi 0.2.12

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

use uapi::*;

#[test]
fn setrlimit_() {
    let mut limit = uapi::getrlimit(c::RLIMIT_NOFILE as _).unwrap();
    assert!(limit.rlim_cur > 0);
    assert!(limit.rlim_cur <= limit.rlim_max);
    limit.rlim_cur -= 1;
    uapi::setrlimit(c::RLIMIT_NOFILE as _, &limit).unwrap();
    let new = uapi::getrlimit(c::RLIMIT_NOFILE as _).unwrap();
    assert_eq!(new.rlim_cur, limit.rlim_cur);
}