unix ExitStatus: Provide .continued()
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
This commit is contained in:
parent
f060b9e0d9
commit
42ea8f6434
@ -187,6 +187,13 @@ pub trait ExitStatusExt {
|
||||
#[unstable(feature = "unix_process_wait_more", issue = "none")]
|
||||
fn stopped_signal(&self) -> Option<i32>;
|
||||
|
||||
/// Whether the process was continued from a stopped status.
|
||||
///
|
||||
/// Ie, `WIFCONTINUED`. This is only possible if the status came from a `wait` system call
|
||||
/// which was passed `WCONTINUED`, was then converted into an `ExitStatus`.
|
||||
#[unstable(feature = "unix_process_wait_more", issue = "none")]
|
||||
fn continued(&self) -> bool;
|
||||
|
||||
/// Returns the underlying raw `wait` status.
|
||||
#[unstable(feature = "unix_process_wait_more", issue = "none")]
|
||||
fn into_raw(self) -> i32;
|
||||
@ -210,6 +217,10 @@ impl ExitStatusExt for process::ExitStatus {
|
||||
self.as_inner().stopped_signal()
|
||||
}
|
||||
|
||||
fn continued(&self) -> bool {
|
||||
self.as_inner().continued()
|
||||
}
|
||||
|
||||
fn into_raw(self) -> i32 {
|
||||
self.as_inner().into_raw().into()
|
||||
}
|
||||
|
@ -490,6 +490,10 @@ impl ExitStatus {
|
||||
if libc::WIFSTOPPED(self.0) { Some(libc::WSTOPSIG(self.0)) } else { None }
|
||||
}
|
||||
|
||||
pub fn continued(&self) -> bool {
|
||||
libc::WIFCONTINUED(self.0)
|
||||
}
|
||||
|
||||
pub fn into_raw(&self) -> c_int {
|
||||
self.0
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user