diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-08-21 20:13:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-21 20:13:18 +0000 |
commit | 8866df67e3601fdce1c0794ad03a01579f8aa0f7 (patch) | |
tree | 1cffb6b526fa4e4239e4780f3bf313aa5e49cb2f /src/sys/ptrace | |
parent | 7207004e108ffbf52e64ed73fe7b43a28b4d5eab (diff) | |
parent | 2decd671f91e7d027896721622a82cf8e00c87a2 (diff) | |
download | nix-8866df67e3601fdce1c0794ad03a01579f8aa0f7.zip |
Merge #1335
1335: Add `PTRACE_EVENT_STOP` enum variant r=asomers a=GabrielMajeri
Adds the `PTRACE_EVENT_STOP` variant to the `ptrace::Event` enum.
Smaller part of #1279
Closes #1334
Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
Diffstat (limited to 'src/sys/ptrace')
-rw-r--r-- | src/sys/ptrace/linux.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/sys/ptrace/linux.rs b/src/sys/ptrace/linux.rs index ef1dafbb..1bfde0d2 100644 --- a/src/sys/ptrace/linux.rs +++ b/src/sys/ptrace/linux.rs @@ -137,9 +137,11 @@ libc_enum!{ /// Event for a stop before an exit. Unlike the waitpid Exit status program. /// registers can still be examined PTRACE_EVENT_EXIT, - /// STop triggered by a seccomp rule on a tracee. + /// Stop triggered by a seccomp rule on a tracee. PTRACE_EVENT_SECCOMP, - // PTRACE_EVENT_STOP not provided by libc because it's defined in glibc 2.26 + /// Stop triggered by the `INTERRUPT` syscall, or a group stop, + /// or when a new child is attached. + PTRACE_EVENT_STOP, } } @@ -401,7 +403,7 @@ pub fn kill(pid: Pid) -> Result<()> { } } -/// Move the stopped tracee process forward by a single step as with +/// Move the stopped tracee process forward by a single step as with /// `ptrace(PTRACE_SINGLESTEP, ...)` /// /// Advances the execution of the process with PID `pid` by a single step optionally delivering a @@ -411,11 +413,11 @@ pub fn kill(pid: Pid) -> Result<()> { /// ```rust /// use nix::sys::ptrace::step; /// use nix::unistd::Pid; -/// use nix::sys::signal::Signal; +/// use nix::sys::signal::Signal; /// use nix::sys::wait::*; /// fn main() { -/// // If a process changes state to the stopped state because of a SIGUSR1 -/// // signal, this will step the process forward and forward the user +/// // If a process changes state to the stopped state because of a SIGUSR1 +/// // signal, this will step the process forward and forward the user /// // signal to the stopped process /// match waitpid(Pid::from_raw(-1), None) { /// Ok(WaitStatus::Stopped(pid, Signal::SIGUSR1)) => { |