c-gull 0.22.3

A libc implementation in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use libc::c_int;

#[no_mangle]
unsafe extern "C" fn get_nprocs_conf() -> c_int {
    //libc!(libc::get_nprocs_conf());

    match std::thread::available_parallelism() {
        Ok(n) => n.get().try_into().unwrap_or(c_int::MAX),
        Err(_) => 1,
    }
}

#[no_mangle]
unsafe extern "C" fn get_nprocs() -> c_int {
    //libc!(libc::get_nprocs());

    get_nprocs_conf()
}