/// via the command line).
///
/// The first element is traditionally the path to the executable, but it can be
-/// set to arbitrary text, and it may not even exist, so this property should
+/// set to arbitrary text, and may not even exist. This means this property should
/// not be relied upon for security purposes.
///
/// # Panics
///
/// The returned iterator will panic during iteration if any argument to the
-/// process is not valid unicode. If this is not desired it is recommended to
+/// process is not valid unicode. If this is not desired,
/// use the `args_os` function instead.
///
/// # Examples
/// Constants associated with the current target
#[stable(feature = "env", since = "1.0.0")]
pub mod consts {
- /// A string describing the architecture of the CPU that this is currently
+ /// A string describing the architecture of the CPU that is currently
/// in use.
///
/// Some possible values:
/// - arm
/// - aarch64
/// - mips
- /// - mipsel
/// - powerpc
/// - powerpc64
- /// - powerpc64le
#[stable(feature = "env", since = "1.0.0")]
pub const ARCH: &'static str = super::arch::ARCH;
/// - bitrig
/// - netbsd
/// - openbsd
+ /// - solaris
/// - android
/// - windows
#[stable(feature = "env", since = "1.0.0")]
pub const EXE_EXTENSION: &'static str = "";
}
+#[cfg(target_os = "solaris")]
+mod os {
+ pub const FAMILY: &'static str = "unix";
+ pub const OS: &'static str = "solaris";
+ pub const DLL_PREFIX: &'static str = "lib";
+ pub const DLL_SUFFIX: &'static str = ".so";
+ pub const DLL_EXTENSION: &'static str = "so";
+ pub const EXE_SUFFIX: &'static str = "";
+ pub const EXE_EXTENSION: &'static str = "";
+}
+
#[cfg(target_os = "windows")]
mod os {
pub const FAMILY: &'static str = "windows";
pub const EXE_EXTENSION: &'static str = "pexe";
}
+#[cfg(target_os = "emscripten")]
+mod os {
+ pub const FAMILY: &'static str = "unix";
+ pub const OS: &'static str = "emscripten";
+ pub const DLL_PREFIX: &'static str = "lib";
+ pub const DLL_SUFFIX: &'static str = ".so";
+ pub const DLL_EXTENSION: &'static str = "so";
+ pub const EXE_SUFFIX: &'static str = ".js";
+ pub const EXE_EXTENSION: &'static str = "js";
+}
+
#[cfg(target_arch = "x86")]
mod arch {
pub const ARCH: &'static str = "x86";
pub const ARCH: &'static str = "mips";
}
-#[cfg(target_arch = "mipsel")]
-mod arch {
- pub const ARCH: &'static str = "mipsel";
-}
-
#[cfg(target_arch = "powerpc")]
mod arch {
pub const ARCH: &'static str = "powerpc";
pub const ARCH: &'static str = "powerpc64";
}
-#[cfg(target_arch = "powerpc64le")]
+#[cfg(target_arch = "le32")]
mod arch {
- pub const ARCH: &'static str = "powerpc64le";
+ pub const ARCH: &'static str = "le32";
}
-#[cfg(target_arch = "le32")]
+#[cfg(target_arch = "asmjs")]
mod arch {
- pub const ARCH: &'static str = "le32";
+ pub const ARCH: &'static str = "asmjs";
}
#[cfg(test)]