#![deny(missing_docs)]
#![allow(stable_features)]
#![cfg_attr(linux_raw, deny(unsafe_code))]
#![cfg_attr(rustc_attrs, feature(rustc_attrs))]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(all(wasi_ext, target_os = "wasi", feature = "std"), feature(wasi_ext))]
#![cfg_attr(core_ffi_c, feature(core_ffi_c))]
#![cfg_attr(core_c_str, feature(core_c_str))]
#![cfg_attr(error_in_core, feature(error_in_core))]
#![cfg_attr(all(feature = "alloc", alloc_c_string), feature(alloc_c_string))]
#![cfg_attr(all(feature = "alloc", alloc_ffi), feature(alloc_ffi))]
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(feature = "rustc-dep-of-std", feature(ip))]
#![cfg_attr(feature = "rustc-dep-of-std", allow(internal_features))]
#![cfg_attr(
any(feature = "rustc-dep-of-std", core_intrinsics),
feature(core_intrinsics)
)]
#![cfg_attr(asm_experimental_arch, feature(asm_experimental_arch))]
#![cfg_attr(not(feature = "all-apis"), allow(dead_code))]
#![allow(clippy::unnecessary_cast)]
#![allow(clippy::useless_conversion)]
#![allow(clippy::needless_lifetimes)]
#![cfg_attr(
any(target_os = "redox", target_os = "wasi", not(feature = "all-apis")),
allow(unused_imports)
)]
#![cfg_attr(
all(
target_os = "wasi",
target_env = "p2",
any(feature = "fs", feature = "mount", feature = "net"),
wasip2,
),
feature(wasip2)
)]
#[cfg(all(feature = "alloc", feature = "rustc-dep-of-std"))]
extern crate rustc_std_workspace_alloc as alloc;
#[cfg(all(feature = "alloc", not(feature = "rustc-dep-of-std")))]
extern crate alloc;
#[cfg(all(test, static_assertions))]
#[macro_use]
#[allow(unused_imports)]
extern crate static_assertions;
#[cfg(all(test, not(static_assertions)))]
#[macro_use]
#[allow(unused_imports)]
mod static_assertions;
pub mod buffer;
#[cfg(not(windows))]
#[macro_use]
pub(crate) mod cstr;
#[macro_use]
pub(crate) mod utils;
#[cfg_attr(feature = "std", path = "maybe_polyfill/std/mod.rs")]
#[cfg_attr(not(feature = "std"), path = "maybe_polyfill/no_std/mod.rs")]
pub(crate) mod maybe_polyfill;
#[cfg(test)]
#[macro_use]
pub(crate) mod check_types;
#[macro_use]
pub(crate) mod bitcast;
#[cfg(any(
all(linux_raw, feature = "use-libc-auxv"),
all(libc, not(any(windows, target_os = "espidf", target_os = "wasi")))
))]
#[macro_use]
mod weak;
#[cfg_attr(libc, path = "backend/libc/mod.rs")]
#[cfg_attr(linux_raw, path = "backend/linux_raw/mod.rs")]
#[cfg_attr(wasi, path = "backend/wasi/mod.rs")]
mod backend;
pub mod fd {
pub use super::backend::fd::*;
}
#[cfg(feature = "event")]
#[cfg_attr(docsrs, doc(cfg(feature = "event")))]
pub mod event;
pub mod ffi;
#[cfg(not(windows))]
#[cfg(feature = "fs")]
#[cfg_attr(docsrs, doc(cfg(feature = "fs")))]
pub mod fs;
pub mod io;
#[cfg(linux_kernel)]
#[cfg(feature = "io_uring")]
#[cfg_attr(docsrs, doc(cfg(feature = "io_uring")))]
pub mod io_uring;
pub mod ioctl;
#[cfg(not(any(
windows,
target_os = "espidf",
target_os = "horizon",
target_os = "vita",
target_os = "wasi"
)))]
#[cfg(feature = "mm")]
#[cfg_attr(docsrs, doc(cfg(feature = "mm")))]
pub mod mm;
#[cfg(linux_kernel)]
#[cfg(feature = "mount")]
#[cfg_attr(docsrs, doc(cfg(feature = "mount")))]
pub mod mount;
#[cfg(not(target_os = "wasi"))]
#[cfg(feature = "net")]
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
pub mod net;
#[cfg(not(any(windows, target_os = "espidf")))]
#[cfg(feature = "param")]
#[cfg_attr(docsrs, doc(cfg(feature = "param")))]
pub mod param;
#[cfg(not(windows))]
#[cfg(any(feature = "fs", feature = "mount", feature = "net"))]
#[cfg_attr(
docsrs,
doc(cfg(any(feature = "fs", feature = "mount", feature = "net")))
)]
pub mod path;
#[cfg(feature = "pipe")]
#[cfg_attr(docsrs, doc(cfg(feature = "pipe")))]
#[cfg(not(any(windows, target_os = "wasi")))]
pub mod pipe;
#[cfg(not(windows))]
#[cfg(feature = "process")]
#[cfg_attr(docsrs, doc(cfg(feature = "process")))]
pub mod process;
#[cfg(not(windows))]
#[cfg(not(target_os = "wasi"))]
#[cfg(feature = "pty")]
#[cfg_attr(docsrs, doc(cfg(feature = "pty")))]
pub mod pty;
#[cfg(not(windows))]
#[cfg(feature = "rand")]
#[cfg_attr(docsrs, doc(cfg(feature = "rand")))]
pub mod rand;
#[cfg(not(any(
windows,
target_os = "android",
target_os = "espidf",
target_os = "horizon",
target_os = "vita",
target_os = "wasi"
)))]
#[cfg(feature = "shm")]
#[cfg_attr(docsrs, doc(cfg(feature = "shm")))]
pub mod shm;
#[cfg(not(windows))]
#[cfg(feature = "stdio")]
#[cfg_attr(docsrs, doc(cfg(feature = "stdio")))]
pub mod stdio;
#[cfg(feature = "system")]
#[cfg(not(any(windows, target_os = "wasi")))]
#[cfg_attr(docsrs, doc(cfg(feature = "system")))]
pub mod system;
#[cfg(not(any(windows, target_os = "horizon", target_os = "vita")))]
#[cfg(feature = "termios")]
#[cfg_attr(docsrs, doc(cfg(feature = "termios")))]
pub mod termios;
#[cfg(not(windows))]
#[cfg(feature = "thread")]
#[cfg_attr(docsrs, doc(cfg(feature = "thread")))]
pub mod thread;
#[cfg(not(any(windows, target_os = "espidf")))]
#[cfg(feature = "time")]
#[cfg_attr(docsrs, doc(cfg(feature = "time")))]
pub mod time;
#[cfg(not(windows))]
#[cfg(feature = "runtime")]
#[cfg(linux_raw)]
#[cfg_attr(not(document_experimental_runtime_api), doc(hidden))]
#[cfg_attr(docsrs, doc(cfg(feature = "runtime")))]
pub mod runtime;
#[cfg(not(windows))]
#[cfg(not(feature = "fs"))]
#[cfg(all(
linux_raw,
not(feature = "use-libc-auxv"),
not(feature = "use-explicitly-provided-auxv"),
any(
feature = "param",
feature = "runtime",
feature = "thread",
feature = "time",
target_arch = "x86",
)
))]
#[cfg_attr(docsrs, doc(cfg(feature = "fs")))]
pub(crate) mod fs;
#[cfg(not(windows))]
#[cfg(not(any(feature = "fs", feature = "mount", feature = "net")))]
#[cfg(all(
linux_raw,
not(feature = "use-libc-auxv"),
not(feature = "use-explicitly-provided-auxv"),
any(
feature = "param",
feature = "runtime",
feature = "thread",
feature = "time",
target_arch = "x86",
)
))]
pub(crate) mod path;
#[cfg(not(any(windows, target_os = "espidf")))]
#[cfg(any(feature = "thread", feature = "time"))]
mod clockid;
#[cfg(linux_kernel)]
#[cfg(any(feature = "io_uring", feature = "runtime"))]
mod kernel_sigset;
#[cfg(not(any(windows, target_os = "wasi")))]
#[cfg(any(
feature = "process",
feature = "runtime",
feature = "termios",
feature = "thread",
all(bsd, feature = "event"),
all(linux_kernel, feature = "net")
))]
mod pid;
#[cfg(any(feature = "process", feature = "thread"))]
#[cfg(linux_kernel)]
mod prctl;
#[cfg(not(any(windows, target_os = "espidf", target_os = "wasi")))]
#[cfg(any(
feature = "io_uring",
feature = "process",
feature = "runtime",
all(bsd, feature = "event")
))]
mod signal;
#[cfg(any(
feature = "fs",
feature = "event",
feature = "process",
feature = "runtime",
feature = "thread",
feature = "time",
all(feature = "event", any(bsd, linux_kernel, windows, target_os = "wasi")),
all(
linux_raw,
not(feature = "use-libc-auxv"),
not(feature = "use-explicitly-provided-auxv"),
any(
feature = "param",
feature = "process",
feature = "runtime",
feature = "time",
target_arch = "x86",
)
)
))]
mod timespec;
#[cfg(not(any(windows, target_os = "wasi")))]
#[cfg(any(
feature = "fs",
feature = "process",
feature = "thread",
all(
linux_raw,
not(feature = "use-libc-auxv"),
not(feature = "use-explicitly-provided-auxv"),
any(
feature = "param",
feature = "runtime",
feature = "time",
target_arch = "x86",
)
),
all(linux_kernel, feature = "net")
))]
mod ugid;
#[cfg(doc)]
#[cfg_attr(docsrs, doc(cfg(doc)))]
pub mod not_implemented;