about summary refs log tree commit diff
path: root/library/std/src/sys/unix/process/process_unix.rs
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2020-12-12 21:44:13 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2021-01-13 12:50:29 +0000
commit3f05051d6bcb7b8562577324d59a2435a40992e9 (patch)
tree2669f529d798fce7d9aa246d605c0e091287f264 /library/std/src/sys/unix/process/process_unix.rs
parent530270f94a3d9f1c23257ad1c9c93675b31ecf6a (diff)
downloadrust-3f05051d6bcb7b8562577324d59a2435a40992e9.tar.gz
rust-3f05051d6bcb7b8562577324d59a2435a40992e9.zip
unix ExitStatus: Provide .core_dumped
This is essential for proper reporting of child process status on Unix.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'library/std/src/sys/unix/process/process_unix.rs')
-rw-r--r--library/std/src/sys/unix/process/process_unix.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/process/process_unix.rs b/library/std/src/sys/unix/process/process_unix.rs
index f1cf4028057..99b1011578a 100644
--- a/library/std/src/sys/unix/process/process_unix.rs
+++ b/library/std/src/sys/unix/process/process_unix.rs
@@ -482,6 +482,10 @@ impl ExitStatus {
         if libc::WIFSIGNALED(self.0) { Some(libc::WTERMSIG(self.0)) } else { None }
     }
 
+    pub fn core_dumped(&self) -> bool {
+        libc::WIFSIGNALED(self.0) && libc::WCOREDUMP(self.0)
+    }
+
     pub fn into_raw(&self) -> c_int {
         self.0
     }