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 {
176
176
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
177
177
fn signal ( & self ) -> Option < i32 > ;
178
178
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
+
179
183
/// Returns the underlying raw `wait` status.
180
184
#[ unstable( feature = "unix_process_wait_more" , issue = "none" ) ]
181
185
fn into_raw ( self ) -> i32 ;
@@ -191,6 +195,10 @@ impl ExitStatusExt for process::ExitStatus {
191
195
self . as_inner ( ) . signal ( )
192
196
}
193
197
198
+ fn core_dumped ( & self ) -> bool {
199
+ self . as_inner ( ) . core_dumped ( )
200
+ }
201
+
194
202
fn into_raw ( self ) -> i32 {
195
203
self . as_inner ( ) . into_raw ( ) . into ( )
196
204
}
Original file line number Diff line number Diff line change @@ -482,6 +482,10 @@ impl ExitStatus {
482
482
if libc:: WIFSIGNALED ( self . 0 ) { Some ( libc:: WTERMSIG ( self . 0 ) ) } else { None }
483
483
}
484
484
485
+ pub fn core_dumped ( & self ) -> bool {
486
+ libc:: WIFSIGNALED ( self . 0 ) && libc:: WCOREDUMP ( self . 0 )
487
+ }
488
+
485
489
pub fn into_raw ( & self ) -> c_int {
486
490
self . 0
487
491
}
You can’t perform that action at this time.
0 commit comments