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
|
|
|
|
2019-06-10 08:12:14 -07:00
|
|
|
cfg_if::cfg_if! {
|
2018-08-04 18:29:47 -05:00
|
|
|
if #[cfg(rustdoc)] {
|
2017-11-20 06:22:17 -08:00
|
|
|
|
|
|
|
|
// When documenting libstd we want to show unix/windows/linux modules as
|
|
|
|
|
// these are the "main modules" that are used across platforms. This
|
|
|
|
|
// should help show platform-specific functionality in a hopefully
|
|
|
|
|
// cross-platform way in the documentation
|
|
|
|
|
|
|
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
2019-02-11 04:23:21 +09:00
|
|
|
pub use crate::sys::unix_ext as unix;
|
2017-11-20 06:22:17 -08:00
|
|
|
|
|
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
2019-02-11 04:23:21 +09:00
|
|
|
pub use crate::sys::windows_ext as windows;
|
2017-11-20 06:22:17 -08:00
|
|
|
|
|
|
|
|
#[doc(cfg(target_os = "linux"))]
|
|
|
|
|
pub mod linux;
|
|
|
|
|
} else {
|
|
|
|
|
|
2018-12-19 11:53:40 +05:30
|
|
|
// 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
|
|
|
|
|
|
|
|
#[cfg(any(target_os = "redox", unix))]
|
|
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
2019-02-11 04:23:21 +09:00
|
|
|
pub use crate::sys::ext as unix;
|
2017-11-20 06:22:17 -08:00
|
|
|
|
|
|
|
|
#[cfg(windows)]
|
|
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
2019-02-11 04:23:21 +09:00
|
|
|
pub use crate::sys::ext as windows;
|
2017-11-20 06:22:17 -08:00
|
|
|
|
|
|
|
|
#[cfg(any(target_os = "linux", target_os = "l4re"))]
|
|
|
|
|
pub mod linux;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-11-26 19:05:10 +00:00
|
|
|
|
2018-12-19 11:53:40 +05:30
|
|
|
#[cfg(target_os = "android")] pub mod android;
|
|
|
|
|
#[cfg(target_os = "dragonfly")] pub mod dragonfly;
|
|
|
|
|
#[cfg(target_os = "freebsd")] pub mod freebsd;
|
|
|
|
|
#[cfg(target_os = "haiku")] pub mod haiku;
|
|
|
|
|
#[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 = "solaris")] pub mod solaris;
|
|
|
|
|
#[cfg(target_os = "emscripten")] pub mod emscripten;
|
|
|
|
|
#[cfg(target_os = "fuchsia")] pub mod fuchsia;
|
|
|
|
|
#[cfg(target_os = "hermit")] pub mod hermit;
|
2019-04-19 09:59:35 -07:00
|
|
|
#[cfg(target_os = "wasi")] pub mod wasi;
|
2018-12-19 17:26:17 +05:30
|
|
|
#[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] pub mod fortanix_sgx;
|
2018-12-19 11:53:40 +05:30
|
|
|
|
2015-04-15 23:21:13 -07:00
|
|
|
pub mod raw;
|