Skip to content

Commit 160602b

Browse files
authored
Rollup merge of rust-lang#90704 - ijackson:exitstatus-comments, r=joshtriplett
Unix ExitStatus comments and a tiny docs fix Some nits left over from rust-lang#88300
2 parents 70532c4 + fe39fb3 commit 160602b

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl CommandExt for process::Command {
207207
/// [`ExitStatusError`](process::ExitStatusError).
208208
///
209209
/// On Unix, `ExitStatus` **does not necessarily represent an exit status**, as
210-
/// passed to the `exit` system call or returned by
210+
/// passed to the `_exit` system call or returned by
211211
/// [`ExitStatus::code()`](crate::process::ExitStatus::code). It represents **any wait status**
212212
/// as returned by one of the `wait` family of system
213213
/// calls.

library/std/src/process.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,11 @@ impl From<fs::File> for Stdio {
14171417
///
14181418
/// [`status`]: Command::status
14191419
/// [`wait`]: Child::wait
1420+
//
1421+
// We speak slightly loosely (here and in various other places in the stdlib docs) about `exit`
1422+
// vs `_exit`. Naming of Unix system calls is not standardised across Unices, so terminology is a
1423+
// matter of convention and tradition. For clarity we usually speak of `exit`, even when we might
1424+
// mean an underlying system call such as `_exit`.
14201425
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
14211426
#[stable(feature = "process", since = "1.0.0")]
14221427
pub struct ExitStatus(imp::ExitStatus);

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

+3
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,9 @@ impl Process {
617617
}
618618

619619
/// Unix exit statuses
620+
//
621+
// This is not actually an "exit status" in Unix terminology. Rather, it is a "wait status".
622+
// See the discussion in comments and doc comments for `std::process::ExitStatus`.
620623
#[derive(PartialEq, Eq, Clone, Copy)]
621624
pub struct ExitStatus(c_int);
622625

0 commit comments

Comments
 (0)