2016-03-04 17:37:11 -05:00
|
|
|
//! OS-specific functionality.
|
2012-03-02 17:20:00 -08:00
|
|
|
|
2015-03-30 11:00:05 -07:00
|
|
|
#![stable(feature = "os", since = "1.0.0")]
|
2018-08-29 08:21:01 -05:00
|
|
|
#![allow(missing_docs, nonstandard_style, missing_debug_implementations)]
|
2012-03-06 18:49:08 -08:00
|
|
|
|
2021-02-24 10:47:26 -08:00
|
|
|
// When documenting libstd we want to show unix/windows/linux/wasi modules as these are the "main
|
2021-02-10 19:35:35 +01:00
|
|
|
// modules" that are used across platforms, so all modules are enabled when `cfg(doc)` is set.
|
|
|
|
|
// This should help show platform-specific functionality in a hopefully cross-platform way in the
|
|
|
|
|
// documentation.
|
|
|
|
|
// Note that we deliberately avoid `cfg_if!` here to work around a rust-analyzer bug that would make
|
|
|
|
|
// `std::os` submodules unusable: https://github.com/rust-analyzer/rust-analyzer/issues/6038
|
2017-11-20 06:22:17 -08:00
|
|
|
|
2021-02-10 19:35:35 +01:00
|
|
|
#[cfg(doc)]
|
|
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
|
|
|
|
pub use crate::sys::unix_ext as unix;
|
2017-11-20 06:22:17 -08:00
|
|
|
|
2021-02-10 19:35:35 +01:00
|
|
|
#[cfg(doc)]
|
|
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
|
|
|
|
pub use crate::sys::windows_ext as windows;
|
2017-11-20 06:22:17 -08:00
|
|
|
|
2021-02-10 19:35:35 +01:00
|
|
|
#[cfg(doc)]
|
|
|
|
|
#[doc(cfg(target_os = "linux"))]
|
|
|
|
|
pub mod linux;
|
2017-11-20 06:22:17 -08:00
|
|
|
|
2021-02-22 14:21:43 -08:00
|
|
|
#[cfg(doc)]
|
2021-02-28 00:48:22 +01:00
|
|
|
#[stable(feature = "wasi_ext_doc", since = "1.35.0")]
|
2021-02-22 14:21:43 -08:00
|
|
|
pub use crate::sys::wasi_ext as wasi;
|
|
|
|
|
|
2021-02-10 19:35:35 +01:00
|
|
|
// If we're not documenting libstd then we just expose the main modules as we otherwise would.
|
2017-11-20 06:22:17 -08:00
|
|
|
|
2021-02-10 19:35:35 +01:00
|
|
|
#[cfg(not(doc))]
|
2021-03-03 01:14:17 +01:00
|
|
|
#[cfg(any(unix, target_os = "hermit"))]
|
2021-02-10 19:35:35 +01:00
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
|
|
|
|
pub use crate::sys::ext as unix;
|
2017-11-20 06:22:17 -08:00
|
|
|
|
2021-02-10 19:35:35 +01:00
|
|
|
#[cfg(not(doc))]
|
|
|
|
|
#[cfg(windows)]
|
|
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
|
|
|
|
pub use crate::sys::ext as windows;
|
2017-11-20 06:22:17 -08:00
|
|
|
|
2021-02-10 19:35:35 +01:00
|
|
|
#[cfg(not(doc))]
|
|
|
|
|
#[cfg(any(target_os = "linux", target_os = "l4re"))]
|
|
|
|
|
pub mod linux;
|
2015-11-26 19:05:10 +00:00
|
|
|
|
2021-02-24 10:43:50 -08:00
|
|
|
#[cfg(not(doc))]
|
|
|
|
|
#[cfg(target_os = "wasi")]
|
|
|
|
|
pub mod wasi;
|
|
|
|
|
|
2019-11-27 10:28:21 -08:00
|
|
|
#[cfg(target_os = "android")]
|
|
|
|
|
pub mod android;
|
|
|
|
|
#[cfg(target_os = "dragonfly")]
|
|
|
|
|
pub mod dragonfly;
|
|
|
|
|
#[cfg(target_os = "emscripten")]
|
|
|
|
|
pub mod emscripten;
|
|
|
|
|
#[cfg(all(target_vendor = "fortanix", target_env = "sgx"))]
|
|
|
|
|
pub mod fortanix_sgx;
|
|
|
|
|
#[cfg(target_os = "freebsd")]
|
|
|
|
|
pub mod freebsd;
|
|
|
|
|
#[cfg(target_os = "fuchsia")]
|
|
|
|
|
pub mod fuchsia;
|
|
|
|
|
#[cfg(target_os = "haiku")]
|
|
|
|
|
pub mod haiku;
|
2020-04-13 23:37:22 +00:00
|
|
|
#[cfg(target_os = "illumos")]
|
|
|
|
|
pub mod illumos;
|
2019-11-27 10:28:21 -08:00
|
|
|
#[cfg(target_os = "ios")]
|
|
|
|
|
pub mod ios;
|
|
|
|
|
#[cfg(target_os = "macos")]
|
|
|
|
|
pub mod macos;
|
|
|
|
|
#[cfg(target_os = "netbsd")]
|
|
|
|
|
pub mod netbsd;
|
|
|
|
|
#[cfg(target_os = "openbsd")]
|
|
|
|
|
pub mod openbsd;
|
|
|
|
|
#[cfg(target_os = "redox")]
|
|
|
|
|
pub mod redox;
|
|
|
|
|
#[cfg(target_os = "solaris")]
|
|
|
|
|
pub mod solaris;
|
|
|
|
|
#[cfg(target_os = "vxworks")]
|
|
|
|
|
pub mod vxworks;
|
2018-12-19 11:53:40 +05:30
|
|
|
|
2015-04-15 23:21:13 -07:00
|
|
|
pub mod raw;
|