1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use crate::dir::SeekLoc;
use cfg_if::cfg_if;
use std::io::Result;

cfg_if! {
    if #[cfg(any(target_os = "linux",
                 target_os = "android"))] {
        mod linux;
        pub(crate) use linux::*;
    } else if #[cfg(target_os = "emscripten")] {
        mod emscripten;
        pub(crate) use emscripten::*;
    } else if #[cfg(any(target_os = "macos",
                        target_os = "ios",
                        target_os = "freebsd",
                        target_os = "netbsd",
                        target_os = "openbsd",
                        target_os = "dragonfly"))] {
        mod bsd;
        pub(crate) use bsd::*;
    } else if #[cfg(target_os = "wasi")] {
        mod wasi;
        pub(crate) use wasi::*;
    } else {
        compile_error!("yanix doesn't compile for this platform yet");
    }
}

pub trait EntryExt {
    fn ino(&self) -> u64;
    fn seek_loc(&self) -> Result<SeekLoc>;
}