mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-28 04:46:44 -04:00
unix: only declare PtraceGetFsBase() on x86-based platforms
Only x86-based CPUs have an FSBASE. The current code happens to build on FreeBSD/aarch64 and FreeBSD/arm, but that's only because we incorrectly declare PTRACE_GETFSBASE on those platforms. Change-Id: I128c91bcdb0704a210af13806c1cd285470b5eda GitHub-Last-Rev: 5e88573c0fde1b565d793948ee7ab54607c463b1 GitHub-Pull-Request: golang/sys#62 Reviewed-on: https://go-review.googlesource.com/c/sys/+/223697 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
committed by
Tobias Klauser
parent
9a0dfc3c55
commit
08c61614be
@@ -55,6 +55,10 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||
|
||||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||
|
||||
func PtraceGetFsBase(pid int, fsbase *int64) (err error) {
|
||||
return ptrace(PTRACE_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0)
|
||||
}
|
||||
|
||||
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
|
||||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)}
|
||||
err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
|
||||
|
||||
Reference in New Issue
Block a user