#![allow(clippy::undocumented_unsafe_blocks)]
#![allow(clippy::useless_conversion)]
#[cfg(not(any(windows, target_os = "wasi")))]
#[macro_use]
mod weak;
mod conv;
mod offset;
#[cfg(windows)]
mod io_lifetimes;
#[cfg(not(windows))]
#[cfg(not(feature = "std"))]
pub(crate) mod fd {
pub(crate) use super::c::c_int as LibcFd;
pub use crate::io::fd::*;
}
#[cfg(windows)]
pub(crate) mod fd {
pub use super::io_lifetimes::*;
}
#[cfg(not(windows))]
#[cfg(feature = "std")]
pub(crate) mod fd {
pub use io_lifetimes::*;
#[cfg(target_os = "wasi")]
#[allow(unused_imports)]
pub(crate) use super::c::c_int as LibcFd;
#[cfg(unix)]
#[allow(unused_imports)]
pub(crate) use std::os::unix::io::RawFd as LibcFd;
#[cfg(unix)]
pub use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
#[cfg(target_os = "wasi")]
pub use std::os::wasi::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
}
#[cfg(windows)]
#[path = "winsock_c.rs"]
pub(crate) mod c;
#[cfg(not(windows))]
pub(crate) use libc as c;
#[cfg(not(windows))]
#[cfg(feature = "fs")]
pub(crate) mod fs;
pub(crate) mod io;
#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(feature = "io_uring")]
pub(crate) mod io_uring;
#[cfg(not(any(windows, target_os = "wasi")))]
#[cfg(feature = "mm")]
pub(crate) mod mm;
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
#[cfg(feature = "net")]
pub(crate) mod net;
#[cfg(not(windows))]
#[cfg(any(
feature = "param",
feature = "runtime",
feature = "time",
target_arch = "x86",
))]
pub(crate) mod param;
#[cfg(not(windows))]
pub(crate) mod process;
#[cfg(not(windows))]
#[cfg(feature = "rand")]
pub(crate) mod rand;
#[cfg(not(windows))]
#[cfg(feature = "termios")]
pub(crate) mod termios;
#[cfg(not(windows))]
#[cfg(feature = "thread")]
pub(crate) mod thread;
#[cfg(not(windows))]
pub(crate) mod time;
#[cfg(all(unix, target_env = "gnu"))]
pub(crate) fn if_glibc_is_less_than_2_25() -> bool {
weak! { fn getrandom(*mut c::c_void, c::size_t, c::c_uint) -> c::ssize_t }
getrandom.get().is_none()
}