]> git.lizzy.rs Git - rust.git/commitdiff
pre_exec: expand docs
authorRalf Jung <post@ralfj.de>
Sat, 2 Feb 2019 10:05:43 +0000 (11:05 +0100)
committerRalf Jung <post@ralfj.de>
Sat, 2 Feb 2019 10:05:43 +0000 (11:05 +0100)
src/libstd/sys/redox/ext/process.rs
src/libstd/sys/unix/ext/process.rs

index 4e669bbb2d7dc8aa7ad19cb38f92ea2db20b1ebc..55824dc4c059f98a72bd4f80b1efbbfd1f10c18f 100644 (file)
@@ -48,7 +48,8 @@ pub trait CommandExt {
     /// This also means that all resources such as file descriptors and
     /// memory-mapped regions got duplicated. It is your responsibility to make
     /// sure that the closure does not violate library invariants by making
-    /// invalid use of these duplicates.
+    /// invalid use of these duplicates.  Moreover, POSIX demands that you only
+    /// perform operations that are explicitly documented as async-signal-safe.
     ///
     /// When this closure is run, aspects such as the stdio file descriptors and
     /// working directory have successfully been changed, so output to these
@@ -60,8 +61,8 @@ unsafe fn pre_exec<F>(&mut self, f: F) -> &mut process::Command
     /// Schedules a closure to be run just before the `exec` function is
     /// invoked.
     ///
-    /// This method should be unsafe, so it got deprecated in favor of the
-    /// unsafe [`pre_exec`].
+    /// This method is stable and usable, but it should be unsafe. To fix
+    /// that, it got deprecated in favor of the unsafe [`pre_exec`].
     ///
     /// [`pre_exec`]: #tymethod.pre_exec
     #[stable(feature = "process_exec", since = "1.15.0")]
index da0507c65423d1212d8a92382ff012f11367ab63..ac0abc761ffb5846ef091f9a046d6ccd008b6dbb 100644 (file)
@@ -48,7 +48,8 @@ pub trait CommandExt {
     /// This also means that all resources such as file descriptors and
     /// memory-mapped regions got duplicated. It is your responsibility to make
     /// sure that the closure does not violate library invariants by making
-    /// invalid use of these duplicates.
+    /// invalid use of these duplicates.  Moreover, POSIX demands that you only
+    /// perform operations that are explicitly documented as async-signal-safe.
     ///
     /// When this closure is run, aspects such as the stdio file descriptors and
     /// working directory have successfully been changed, so output to these
@@ -60,8 +61,8 @@ unsafe fn pre_exec<F>(&mut self, f: F) -> &mut process::Command
     /// Schedules a closure to be run just before the `exec` function is
     /// invoked.
     ///
-    /// This method should be unsafe, so it got deprecated in favor of the
-    /// unsafe [`pre_exec`].
+    /// This method is stable and usable, but it should be unsafe. To fix
+    /// that, it got deprecated in favor of the unsafe [`pre_exec`].
     ///
     /// [`pre_exec`]: #tymethod.pre_exec
     #[stable(feature = "process_exec", since = "1.15.0")]