Pārlūkot izejas kodu

unix: add PtracePokeUser

PtracePeekUser was already added in CL 38638, also add its "counterpart"
allowing to modify the tracee's user area.

Change-Id: Id84e85fe17b5cab7df5ecc83b6b7b8a39241241d
Reviewed-on: https://go-review.googlesource.com/76670
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Tobias Klauser 8 gadi atpakaļ
vecāks
revīzija
1e2299c37c
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4 0
      unix/syscall_linux.go

+ 4 - 0
unix/syscall_linux.go

@@ -1125,6 +1125,10 @@ func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error) {
 	return ptracePoke(PTRACE_POKEDATA, PTRACE_PEEKDATA, pid, addr, data)
 }
 
+func PtracePokeUser(pid int, addr uintptr, data []byte) (count int, err error) {
+	return ptracePoke(PTRACE_POKEUSR, PTRACE_PEEKUSR, pid, addr, data)
+}
+
 func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
 	return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
 }