Enum nix::sys::wait::WaitStatus [−][src]
pub enum WaitStatus { Exited(Pid, i8), Signaled(Pid, Signal, bool), Stopped(Pid, Signal), PtraceEvent(Pid, Signal, c_int), PtraceSyscall(Pid), Continued(Pid), StillAlive, }
Possible return values from wait()
or waitpid()
.
Each status (other than StillAlive
) describes a state transition
in a child process Pid
, such as the process exiting or stopping,
plus additional data about the transition if any.
Note that there are two Linux-specific enum variants, PtraceEvent
and PtraceSyscall
. Portable code should avoid exhaustively
matching on WaitStatus
.
Variants
Exited(Pid, i8)
The process exited normally (as with exit()
or returning from
main
) with the given exit code. This case matches the C macro
WIFEXITED(status)
; the second field is WEXITSTATUS(status)
.
Signaled(Pid, Signal, bool)
The process was killed by the given signal. The third field
indicates whether the signal generated a core dump. This case
matches the C macro WIFSIGNALED(status)
; the last two fields
correspond to WTERMSIG(status)
and WCOREDUMP(status)
.
Stopped(Pid, Signal)
The process is alive, but was stopped by the given signal. This
is only reported if WaitPidFlag::WUNTRACED
was passed. This
case matches the C macro WIFSTOPPED(status)
; the second field
is WSTOPSIG(status)
.
PtraceEvent(Pid, Signal, c_int)
The traced process was stopped by a PTRACE_EVENT_*
event. See
nix::sys::ptrace
and ptrace
(2) for more information. All
currently-defined events use SIGTRAP
as the signal; the third
field is the PTRACE_EVENT_*
value of the event.
PtraceSyscall(Pid)
The traced process was stopped by execution of a system call,
and PTRACE_O_TRACESYSGOOD
is in effect. See ptrace
(2) for
more information.
Continued(Pid)
The process was previously stopped but has resumed execution
after receiving a SIGCONT
signal. This is only reported if
WaitPidFlag::WCONTINUED
was passed. This case matches the C
macro WIFCONTINUED(status)
.
StillAlive
There are currently no state changes to report in any awaited
child process. This is only returned if WaitPidFlag::WNOHANG
was used (otherwise wait()
or waitpid()
would block until
there was something to report).
Trait Implementations
impl Eq for WaitStatus
[src]
impl Eq for WaitStatus
impl PartialEq for WaitStatus
[src]
impl PartialEq for WaitStatus
fn eq(&self, other: &WaitStatus) -> bool
[src]
fn eq(&self, other: &WaitStatus) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &WaitStatus) -> bool
[src]
fn ne(&self, other: &WaitStatus) -> bool
This method tests for !=
.
impl Clone for WaitStatus
[src]
impl Clone for WaitStatus
fn clone(&self) -> WaitStatus
[src]
fn clone(&self) -> WaitStatus
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for WaitStatus
[src]
impl Copy for WaitStatus
impl Debug for WaitStatus
[src]
impl Debug for WaitStatus
Auto Trait Implementations
impl Send for WaitStatus
impl Send for WaitStatus
impl Sync for WaitStatus
impl Sync for WaitStatus