Browse Source

unix: add new func PtraceInterrupt on Linux

Add to the unix package a new func to allow ptrace using PTRACE_INTERRUPT.

Fixes golang/go#34755

Change-Id: Ie50ae14c6eb5b3005dda2f8eefee57dd5bd6f360
GitHub-Last-Rev: 7e93ff4d870a9947b044d0dc5dc48e5d61dad3e0
GitHub-Pull-Request: golang/sys#45
Reviewed-on: https://go-review.googlesource.com/c/sys/+/199504
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Paulo Gomes 6 years ago
parent
commit
543471e840
1 changed files with 2 additions and 0 deletions
  1. 2 0
      unix/syscall_linux.go

+ 2 - 0
unix/syscall_linux.go

@@ -1493,6 +1493,8 @@ func PtraceSyscall(pid int, signal int) (err error) {
 
 func PtraceSingleStep(pid int) (err error) { return ptrace(PTRACE_SINGLESTEP, pid, 0, 0) }
 
+func PtraceInterrupt(pid int) (err error) { return ptrace(PTRACE_INTERRUPT, pid, 0, 0) }
+
 func PtraceAttach(pid int) (err error) { return ptrace(PTRACE_ATTACH, pid, 0, 0) }
 
 func PtraceSeize(pid int) (err error) { return ptrace(PTRACE_SEIZE, pid, 0, 0) }