Skip to content

Commit 19860ee

Browse files
committed
Add PTRACE_EVENT_STOP enum variant
1 parent 7207004 commit 19860ee

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/sys/ptrace/linux.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,11 @@ libc_enum!{
137137
/// Event for a stop before an exit. Unlike the waitpid Exit status program.
138138
/// registers can still be examined
139139
PTRACE_EVENT_EXIT,
140-
/// STop triggered by a seccomp rule on a tracee.
140+
/// Stop triggered by a seccomp rule on a tracee.
141141
PTRACE_EVENT_SECCOMP,
142-
// PTRACE_EVENT_STOP not provided by libc because it's defined in glibc 2.26
142+
/// Stop triggered by the `INTERRUPT` syscall, or a group stop,
143+
/// or when a new child is attached.
144+
PTRACE_EVENT_STOP,
143145
}
144146
}
145147

@@ -401,7 +403,7 @@ pub fn kill(pid: Pid) -> Result<()> {
401403
}
402404
}
403405

404-
/// Move the stopped tracee process forward by a single step as with
406+
/// Move the stopped tracee process forward by a single step as with
405407
/// `ptrace(PTRACE_SINGLESTEP, ...)`
406408
///
407409
/// 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<()> {
411413
/// ```rust
412414
/// use nix::sys::ptrace::step;
413415
/// use nix::unistd::Pid;
414-
/// use nix::sys::signal::Signal;
416+
/// use nix::sys::signal::Signal;
415417
/// use nix::sys::wait::*;
416418
/// fn main() {
417-
/// // If a process changes state to the stopped state because of a SIGUSR1
418-
/// // signal, this will step the process forward and forward the user
419+
/// // If a process changes state to the stopped state because of a SIGUSR1
420+
/// // signal, this will step the process forward and forward the user
419421
/// // signal to the stopped process
420422
/// match waitpid(Pid::from_raw(-1), None) {
421423
/// Ok(WaitStatus::Stopped(pid, Signal::SIGUSR1)) => {

0 commit comments

Comments
 (0)