<commit_before>pub use self::os::{flock};
pub use self::os::{F_DUPFD};
pub use self::os::{F_DUPFD_CLOEXEC};
pub use self::os::{F_GETFD};
pub use self::os::{F_SETFD};
pub use self::os::{F_GETFL};
pub use self::os::{F_SETFL};
pub use self::os::{F_GETLK};
pub use self::os::{F_SETLK};
pub use self::os::{F_SETLKW};
pub use self::os::{F_GETOWN};
pub use self::os::{F_SETOWN};
pub use self::os::{FD_CLOEXEC};
pub use self::os::{F_RDLCK};
pub use self::os::{F_UNLCK};
pub use self::os::{F_WRLCK};
pub use self::os::{O_CLOEXEC};
pub use self::os::{O_CREAT};
pub use self::os::{O_DIRECTORY};
pub use self::os::{O_EXCL};
pub use self::os::{O_NOCTTY};
pub use self::os::{O_NOFOLLOW};
pub use self::os::{O_TRUNC};
pub use self::os::{O_APPEND};
pub use self::os::{O_DSYNC};
pub use self::os::{O_NONBLOCK};
pub use self::os::{O_RSYNC};
pub use self::os::{O_SYNC};
pub use self::os::{O_ACCMODE};
pub use self::os::{O_RDONLY};
pub use self::os::{O_RDWR};
pub use self::os::{O_WRONLY};
pub use self::os::{AT_FDCWD};
pub use self::os::{AT_EACCESS};
pub use self::os::{AT_SYMLINK_NOFOLLOW};
pub use self::os::{AT_SYMLINK_FOLLOW};
pub use self::os::{AT_REMOVEDIR};
pub use self::os::{POSIX_FADV_DONTNEED};
pub use self::os::{POSIX_FADV_NOREUSE};
pub use self::os::{POSIX_FADV_NORMAL};
pub use self::os::{POSIX_FADV_RANDOM};
pub use self::os::{POSIX_FADV_SEQUENTIAL};
pub use self::os::{POSIX_FADV_WILLNEED};

use {NTStr, int_t, char_t};
use sys::types::{mode_t, off_t};

#[cfg(target_os = "linux")]
#[path = "linux/mod.rs"]
mod os;

pub fn creat<T: NTStr>(file: &T, mode: mode_t) -> int_t {
    extern { fn creat(file: *const char_t, mode: mode_t) -> int_t; }
    unsafe { creat(file.as_ptr(), mode) }
}

pub fn posix_fadvise(fd: int_t, off: off_t, len: off_t, advise: int_t) -> int_t {
    extern {
        fn posix_fadvise(fd: int_t, off: off_t, len: off_t, advise: int_t) -> int_t;
    }
    unsafe { posix_fadvise(fd, off, len, advise) }
}

pub fn posix_fallocate(fd: int_t, off: off_t, len: off_t) -> int_t {
    extern { fn posix_fallocate(fd: int_t, off: off_t, len: off_t) -> int_t; }
    unsafe { posix_fallocate(fd, off, len) }
}

extern "C" {
    pub fn fcntl(fd: int_t, cmd: int_t, ...) -> int_t;
    pub fn open(file: *const char_t, oflag: int_t, ...) -> int_t;
    pub fn openat(fd: int_t, file: *const char_t, oflag: int_t, ...) -> int_t;
}<commit_msg>fcntl::open1<commit_after>pub use self::os::{flock};
pub use self::os::{F_DUPFD};
pub use self::os::{F_DUPFD_CLOEXEC};
pub use self::os::{F_GETFD};
pub use self::os::{F_SETFD};
pub use self::os::{F_GETFL};
pub use self::os::{F_SETFL};
pub use self::os::{F_GETLK};
pub use self::os::{F_SETLK};
pub use self::os::{F_SETLKW};
pub use self::os::{F_GETOWN};
pub use self::os::{F_SETOWN};
pub use self::os::{FD_CLOEXEC};
pub use self::os::{F_RDLCK};
pub use self::os::{F_UNLCK};
pub use self::os::{F_WRLCK};
pub use self::os::{O_CLOEXEC};
pub use self::os::{O_CREAT};
pub use self::os::{O_DIRECTORY};
pub use self::os::{O_EXCL};
pub use self::os::{O_NOCTTY};
pub use self::os::{O_NOFOLLOW};
pub use self::os::{O_TRUNC};
pub use self::os::{O_APPEND};
pub use self::os::{O_DSYNC};
pub use self::os::{O_NONBLOCK};
pub use self::os::{O_RSYNC};
pub use self::os::{O_SYNC};
pub use self::os::{O_ACCMODE};
pub use self::os::{O_RDONLY};
pub use self::os::{O_RDWR};
pub use self::os::{O_WRONLY};
pub use self::os::{AT_FDCWD};
pub use self::os::{AT_EACCESS};
pub use self::os::{AT_SYMLINK_NOFOLLOW};
pub use self::os::{AT_SYMLINK_FOLLOW};
pub use self::os::{AT_REMOVEDIR};
pub use self::os::{POSIX_FADV_DONTNEED};
pub use self::os::{POSIX_FADV_NOREUSE};
pub use self::os::{POSIX_FADV_NORMAL};
pub use self::os::{POSIX_FADV_RANDOM};
pub use self::os::{POSIX_FADV_SEQUENTIAL};
pub use self::os::{POSIX_FADV_WILLNEED};

use {NTStr, int_t, char_t};
use sys::types::{mode_t, off_t};

#[cfg(target_os = "linux")]
#[path = "linux/mod.rs"]
mod os;

pub fn creat<T: NTStr>(file: &T, mode: mode_t) -> int_t {
    extern { fn creat(file: *const char_t, mode: mode_t) -> int_t; }
    unsafe { creat(file.as_ptr(), mode) }
}

pub fn posix_fadvise(fd: int_t, off: off_t, len: off_t, advise: int_t) -> int_t {
    extern {
        fn posix_fadvise(fd: int_t, off: off_t, len: off_t, advise: int_t) -> int_t;
    }
    unsafe { posix_fadvise(fd, off, len, advise) }
}

pub fn posix_fallocate(fd: int_t, off: off_t, len: off_t) -> int_t {
    extern { fn posix_fallocate(fd: int_t, off: off_t, len: off_t) -> int_t; }
    unsafe { posix_fallocate(fd, off, len) }
}

pub fn open1<T: NTStr>(file: &T, oflag: int_t) -> int_t {
    unsafe { open(file.as_ptr(), oflag) }
}

extern "C" {
    pub fn fcntl(fd: int_t, cmd: int_t, ...) -> int_t;
    pub fn open(file: *const char_t, oflag: int_t, ...) -> int_t;
    pub fn openat(fd: int_t, file: *const char_t, oflag: int_t, ...) -> int_t;
}
{'fraction_non_alphanumeric': 0.2019591496456857, 'fraction_numerical': 0.00041684035014589413, 'mean_word_length': 5.721288515406163, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6491654', 'n_tokens_mistral': 2087, 'n_tokens_neox': 2157, 'n_words': 485}