Expand description
This crate allows you to spawn a child process with ptrace
enabled.
It provides a single trait—CommandPtraceSpawn
—that is implemented for
std::process::Command
, giving you access to a spawn_ptrace
method.
Processes spawned this way will be stopped with SIGTRAP
from their
exec
, so you can perform any early intervention you require prior to the
process running any code and then use PTRACE_CONT
to resume its execution.
§Examples
use spawn_ptrace::CommandPtraceSpawn;
use std::process::Command;
let child = Command::new("/bin/ls").spawn_ptrace()?;
// call `ptrace(PTRACE_CONT, child.id(), ...)` to continue execution
// do other ptrace things here...
Traits§
- Command
Ptrace Spawn - A Unix-specific extension to
std::process::Command
to spawn a process withptrace
enabled.