@@ -98,11 +98,9 @@ libc_enum!{
9898 #[ cfg( all( target_os = "linux" , not( any( target_arch = "mips" ,
9999 target_arch = "mips64" ) ) ) ) ]
100100 PTRACE_SETREGSET ,
101- #[ cfg( all( target_os = "linux" , not( any( target_arch = "mips" ,
102- target_arch = "mips64" ) ) ) ) ]
101+ #[ cfg( target_os = "linux" ) ]
103102 PTRACE_SEIZE ,
104- #[ cfg( all( target_os = "linux" , not( any( target_arch = "mips" ,
105- target_arch = "mips64" ) ) ) ) ]
103+ #[ cfg( target_os = "linux" ) ]
106104 PTRACE_INTERRUPT ,
107105 #[ cfg( all( target_os = "linux" , not( any( target_arch = "mips" ,
108106 target_arch = "mips64" ) ) ) ) ]
@@ -339,7 +337,7 @@ pub fn attach(pid: Pid) -> Result<()> {
339337/// Attach to a running process, as with `ptrace(PTRACE_SEIZE, ...)`
340338///
341339/// Attaches to the process specified in pid, making it a tracee of the calling process.
342- #[ cfg( all ( target_os = "linux" , not ( any ( target_arch = "mips" , target_arch = "mips64" ) ) ) ) ]
340+ #[ cfg( target_os = "linux" ) ]
343341pub fn seize ( pid : Pid , options : Options ) -> Result < ( ) > {
344342 unsafe {
345343 ptrace_other (
@@ -384,6 +382,16 @@ pub fn cont<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> {
384382 }
385383}
386384
385+ /// Stop a tracee, as with `ptrace(PTRACE_INTERRUPT, ...)`
386+ ///
387+ /// This request is equivalent to `ptrace(PTRACE_INTERRUPT, ...)`
388+ #[ cfg( target_os = "linux" ) ]
389+ pub fn interrupt ( pid : Pid ) -> Result < ( ) > {
390+ unsafe {
391+ ptrace_other ( Request :: PTRACE_INTERRUPT , pid, ptr:: null_mut ( ) , ptr:: null_mut ( ) ) . map ( drop)
392+ }
393+ }
394+
387395/// Issues a kill request as with `ptrace(PTRACE_KILL, ...)`
388396///
389397/// This request is equivalent to `ptrace(PTRACE_CONT, ..., SIGKILL);`
0 commit comments