]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #90704 - ijackson:exitstatus-comments, r=joshtriplett
authorMatthias Krüger <matthias.krueger@famsik.de>
Fri, 12 Nov 2021 18:17:31 +0000 (19:17 +0100)
committerGitHub <noreply@github.com>
Fri, 12 Nov 2021 18:17:31 +0000 (19:17 +0100)
Unix ExitStatus comments and a tiny docs fix

Some nits left over from #88300

library/std/src/os/unix/process.rs
library/std/src/process.rs
library/std/src/sys/unix/process/process_unix.rs

index 01b8303a6c3898be15c650d5bbbcfbd2f68f47b2..855f900430c4a4d05636ab6e6a0cf4ef6e0c6ec2 100644 (file)
@@ -207,7 +207,7 @@ fn arg0<S>(&mut self, arg: S) -> &mut process::Command
 /// [`ExitStatusError`](process::ExitStatusError).
 ///
 /// On Unix, `ExitStatus` **does not necessarily represent an exit status**, as
-/// passed to the `exit` system call or returned by
+/// passed to the `_exit` system call or returned by
 /// [`ExitStatus::code()`](crate::process::ExitStatus::code).  It represents **any wait status**
 /// as returned by one of the `wait` family of system
 /// calls.
index 9cc7fc2f0352e6e09b2fa7ab9565fc3936bc165a..b4dab41f06632f8b3cbb09421d4a9c4974c5bb91 100644 (file)
@@ -1417,6 +1417,11 @@ fn from(file: fs::File) -> Stdio {
 ///
 /// [`status`]: Command::status
 /// [`wait`]: Child::wait
+//
+// We speak slightly loosely (here and in various other places in the stdlib docs) about `exit`
+// vs `_exit`.  Naming of Unix system calls is not standardised across Unices, so terminology is a
+// matter of convention and tradition.  For clarity we usually speak of `exit`, even when we might
+// mean an underlying system call such as `_exit`.
 #[derive(PartialEq, Eq, Clone, Copy, Debug)]
 #[stable(feature = "process", since = "1.0.0")]
 pub struct ExitStatus(imp::ExitStatus);
index 326382d9038a8a1e2c9c36361e07e58a89bcc4f1..3bf1493f3b8cbd6860cadddd0f7f44789b47d95d 100644 (file)
@@ -617,6 +617,9 @@ pub fn try_wait(&mut self) -> io::Result<Option<ExitStatus>> {
 }
 
 /// Unix exit statuses
+//
+// This is not actually an "exit status" in Unix terminology.  Rather, it is a "wait status".
+// See the discussion in comments and doc comments for `std::process::ExitStatus`.
 #[derive(PartialEq, Eq, Clone, Copy)]
 pub struct ExitStatus(c_int);