Skip to content

Commit

Permalink
unix: use SYS_PTRACE in generated ptracePtr
Browse files Browse the repository at this point in the history
CL 469835 broke the syscall wrapper generation on linux and freebsd by
generating a wrapper for the inexistent SYS_PTRACE_PTR syscall. The
ptracePtr added by CL 469835 correctly uses SYS_PTRACE, likely because
it was manually edited in that CL. However, the incorrect SYS_PTRACE_PTR
syscall is used when regenerating the syscall wrappers.

Change-Id: I270d66511f926d30a9d347930e977a026e033998
Reviewed-on: https://go-review.googlesource.com/c/sys/+/470175
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
  • Loading branch information
tklauser authored and gopherbot committed Feb 22, 2023
1 parent 71a906e commit a3b23cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion unix/syscall_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
}

//sys ptrace(request int, pid int, addr uintptr, data int) (err error)
//sys ptracePtr(request int, pid int, addr unsafe.Pointer, data int) (err error)
//sys ptracePtr(request int, pid int, addr unsafe.Pointer, data int) (err error) = SYS_PTRACE

func PtraceAttach(pid int) (err error) {
return ptrace(PT_ATTACH, pid, 0, 0)
Expand Down
2 changes: 1 addition & 1 deletion unix/syscall_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ func BindToDevice(fd int, device string) (err error) {
}

//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
//sys ptracePtr(request int, pid int, addr uintptr, data unsafe.Pointer) (err error)
//sys ptracePtr(request int, pid int, addr uintptr, data unsafe.Pointer) (err error) = SYS_PTRACE

func ptracePeek(req int, pid int, addr uintptr, out []byte) (count int, err error) {
// The peek requests are machine-size oriented, so we wrap it
Expand Down
4 changes: 3 additions & 1 deletion unix/zsyscall_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a3b23cc

Please sign in to comment.