File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,10 @@ pub trait ExitStatusExt {
176176 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
177177 fn signal ( & self ) -> Option < i32 > ;
178178
179+ /// If the process was terminated by a signal, says whether it dumped core.
180+ #[ unstable( feature = "unix_process_wait_more" , issue = "none" ) ]
181+ fn core_dumped ( & self ) -> bool ;
182+
179183 /// Returns the underlying raw `wait` status.
180184 #[ unstable( feature = "unix_process_wait_more" , issue = "none" ) ]
181185 fn into_raw ( self ) -> i32 ;
@@ -191,6 +195,10 @@ impl ExitStatusExt for process::ExitStatus {
191195 self . as_inner ( ) . signal ( )
192196 }
193197
198+ fn core_dumped ( & self ) -> bool {
199+ self . as_inner ( ) . core_dumped ( )
200+ }
201+
194202 fn into_raw ( self ) -> i32 {
195203 self . as_inner ( ) . into_raw ( ) . into ( )
196204 }
Original file line number Diff line number Diff line change @@ -482,6 +482,10 @@ impl ExitStatus {
482482 if libc:: WIFSIGNALED ( self . 0 ) { Some ( libc:: WTERMSIG ( self . 0 ) ) } else { None }
483483 }
484484
485+ pub fn core_dumped ( & self ) -> bool {
486+ libc:: WIFSIGNALED ( self . 0 ) && libc:: WCOREDUMP ( self . 0 )
487+ }
488+
485489 pub fn into_raw ( & self ) -> c_int {
486490 self . 0
487491 }
You can’t perform that action at this time.
0 commit comments