]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/env.rs
CStr::from_bytes
[rust.git] / src / libstd / env.rs
index db136190082b9b4bfed5c2c5ea3553dcbd9a2276..f7e13a35e9e502ea57422bdcd70c2d51eb7eb86c 100644 (file)
@@ -528,13 +528,13 @@ pub struct ArgsOs { inner: os_imp::Args }
 /// 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
@@ -603,7 +603,7 @@ fn len(&self) -> usize { self.inner.len() }
 /// 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:
@@ -613,10 +613,8 @@ pub mod consts {
     /// - arm
     /// - aarch64
     /// - mips
-    /// - mipsel
     /// - powerpc
     /// - powerpc64
-    /// - powerpc64le
     #[stable(feature = "env", since = "1.0.0")]
     pub const ARCH: &'static str = super::arch::ARCH;
 
@@ -642,6 +640,7 @@ pub mod consts {
     /// - bitrig
     /// - netbsd
     /// - openbsd
+    /// - solaris
     /// - android
     /// - windows
     #[stable(feature = "env", since = "1.0.0")]
@@ -802,6 +801,17 @@ mod os {
     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";
@@ -834,6 +844,17 @@ mod os {
     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";
@@ -859,11 +880,6 @@ mod arch {
     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";
@@ -874,14 +890,14 @@ mod arch {
     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)]