c-scape 0.22.3

A libc bottom-half implementation in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
use libc::{c_int, c_void};

use super::CScapeDir;

#[no_mangle]
unsafe extern "C" fn dirfd(dir: *mut c_void) -> c_int {
    libc!(libc::dirfd(dir.cast()));

    let dir = dir.cast::<CScapeDir>();
    (*dir).fd
}