aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
Diffstat (limited to 'libgo')
-rw-r--r--libgo/go/syscall/libcall_glibc.go2
-rw-r--r--libgo/go/syscall/libcall_linux.go2
-rw-r--r--libgo/runtime/go-varargs.c16
3 files changed, 18 insertions, 2 deletions
diff --git a/libgo/go/syscall/libcall_glibc.go b/libgo/go/syscall/libcall_glibc.go
index a90fc9b..823343d 100644
--- a/libgo/go/syscall/libcall_glibc.go
+++ b/libgo/go/syscall/libcall_glibc.go
@@ -32,7 +32,7 @@ func Futimes(fd int, tv []Timeval) (err error) {
}
//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
-//ptrace(request _C_int, pid Pid_t, addr *byte, data *byte) _C_long
+//__go_ptrace(request _C_int, pid Pid_t, addr *byte, data *byte) _C_long
//sys accept4(fd int, sa *RawSockaddrAny, len *Socklen_t, flags int) (nfd int, err error)
//accept4(fd _C_int, sa *RawSockaddrAny, len *Socklen_t, flags _C_int) _C_int
diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go
index 88286c0..78fda0e 100644
--- a/libgo/go/syscall/libcall_linux.go
+++ b/libgo/go/syscall/libcall_linux.go
@@ -11,7 +11,7 @@ import (
)
//sysnb raw_ptrace(request int, pid int, addr *byte, data *byte) (err Errno)
-//ptrace(request _C_int, pid Pid_t, addr *byte, data *byte) _C_long
+//__go_ptrace(request _C_int, pid Pid_t, addr *byte, data *byte) _C_long
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
diff --git a/libgo/runtime/go-varargs.c b/libgo/runtime/go-varargs.c
index 2b186ef..f9270a9 100644
--- a/libgo/runtime/go-varargs.c
+++ b/libgo/runtime/go-varargs.c
@@ -18,6 +18,9 @@
#ifdef HAVE_SYS_SYSCALL_H
#include <sys/syscall.h>
#endif
+#ifdef HAVE_SYS_PTRACE_H
+#include <sys/ptrace.h>
+#endif
/* The syscall package calls C functions. The Go compiler can not
represent a C varargs functions. On some systems it's important
@@ -110,3 +113,16 @@ __go_syscall6(uintptr_t flag, uintptr_t a1, uintptr_t a2, uintptr_t a3,
}
#endif
+
+#ifdef HAVE_SYS_PTRACE_H
+
+// Despite documented appearances, this is actually implemented as
+// a variadic function within glibc.
+
+long
+__go_ptrace(int request, pid_t pid, uintptr_t addr, uintptr_t data)
+{
+ return ptrace (request, pid, addr, data);
+}
+
+#endif