1 //! OS-specific functionality.
3 #![stable(feature = "os", since = "1.0.0")]
4 #![allow(missing_docs, nonstandard_style, missing_debug_implementations)]
8 // The code below could be written clearer using `cfg_if!`. However, the items below are
9 // publicly exported by `std` and external tools can have trouble analysing them because of the use
10 // of a macro that is not vendored by Rust and included in the toolchain.
11 // See https://github.com/rust-analyzer/rust-analyzer/issues/6038.
16 all(target_arch = "wasm32", not(target_os = "wasi")),
17 all(target_vendor = "fortanix", target_env = "sgx")
22 // When documenting std we want to show the `unix`, `windows`, `linux` and `wasi`
23 // modules as these are the "main modules" that are used across platforms,
24 // so these modules are enabled when `cfg(doc)` is set.
25 // This should help show platform-specific functionality in a hopefully cross-platform
26 // way in the documentation.
39 all(target_arch = "wasm32", not(target_os = "wasi")),
40 all(target_vendor = "fortanix", target_env = "sgx")
44 // On certain platforms right now the "main modules" modules that are
45 // documented don't compile (missing things in `libc` which is empty),
46 // so just omit them with an empty module.
48 #[unstable(issue = "none", feature = "std_internals")]
51 #[unstable(issue = "none", feature = "std_internals")]
54 #[unstable(issue = "none", feature = "std_internals")]
57 #[unstable(issue = "none", feature = "std_internals")]
61 #[stable(feature = "os", since = "1.0.0")]
67 // If we're not documenting std then we only expose modules appropriate for the
70 #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))]
73 #[cfg(target_os = "hermit")]
74 #[path = "hermit/mod.rs"]
77 #[cfg(target_os = "android")]
79 #[cfg(target_os = "dragonfly")]
81 #[cfg(target_os = "emscripten")]
83 #[cfg(target_os = "freebsd")]
85 #[cfg(target_os = "fuchsia")]
87 #[cfg(target_os = "haiku")]
89 #[cfg(target_os = "illumos")]
91 #[cfg(target_os = "ios")]
93 #[cfg(target_os = "l4re")]
95 #[cfg(target_os = "linux")]
97 #[cfg(target_os = "macos")]
99 #[cfg(target_os = "netbsd")]
101 #[cfg(target_os = "openbsd")]
103 #[cfg(target_os = "redox")]
105 #[cfg(target_os = "solaris")]
110 #[cfg(target_os = "vxworks")]
113 #[cfg(target_os = "wasi")]
120 #[stable(feature = "os", since = "1.0.0")]