From afadfcc7779c1f4db0f6f6438afcb108d9c9c7cd Mon Sep 17 00:00:00 2001 From: Agis Anastasopoulos Date: Sat, 25 Mar 2017 16:33:42 +0200 Subject: [PATCH] unix: add PtracePeekUser Fixes golang/go#14459 Change-Id: I9809340141dd5704d5a32a079486a1f889725541 Reviewed-on: https://go-review.googlesource.com/38638 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- unix/syscall_linux.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unix/syscall_linux.go b/unix/syscall_linux.go index 1ff45e9f..95fba4c4 100644 --- a/unix/syscall_linux.go +++ b/unix/syscall_linux.go @@ -881,6 +881,10 @@ func PtracePeekData(pid int, addr uintptr, out []byte) (count int, err error) { return ptracePeek(PTRACE_PEEKDATA, pid, addr, out) } +func PtracePeekUser(pid int, addr uintptr, out []byte) (count int, err error) { + return ptracePeek(PTRACE_PEEKUSR, pid, addr, out) +} + func ptracePoke(pokeReq int, peekReq int, pid int, addr uintptr, data []byte) (count int, err error) { // As for ptracePeek, we need to align our accesses to deal // with the possibility of straddling an invalid page.