From dd79b330c9115a62a482c655edb7911c8121744c Mon Sep 17 00:00:00 2001 From: Dave Cheney Date: Sat, 1 Sep 2012 09:17:14 +1000 Subject: [PATCH] syscall: add PtraceSyscall(pid int, signal int) Fixes #3525. PTRACE_SYSCALL behaves like PTRACE_CONT and can deliver a signal to the process. Ideally PtraceSingleStep should support the signal argument, but its interface is frozen by Go1. R=golang-dev, r, rsc CC=golang-dev https://golang.org/cl/6353051 --- src/pkg/syscall/syscall_linux.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pkg/syscall/syscall_linux.go b/src/pkg/syscall/syscall_linux.go index 7b79073eb11..fbe6b045769 100644 --- a/src/pkg/syscall/syscall_linux.go +++ b/src/pkg/syscall/syscall_linux.go @@ -735,6 +735,10 @@ func PtraceCont(pid int, signal int) (err error) { return ptrace(PTRACE_CONT, pid, 0, uintptr(signal)) } +func PtraceSyscall(pid int, signal int) (err error) { + return ptrace(PTRACE_SYSCALL, pid, 0, uintptr(signal)) +} + func PtraceSingleStep(pid int) (err error) { return ptrace(PTRACE_SINGLESTEP, pid, 0, 0) } func PtraceAttach(pid int) (err error) { return ptrace(PTRACE_ATTACH, pid, 0, 0) }