aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-10-12 09:46:38 -0700
committerIan Lance Taylor <iant@golang.org>2020-10-12 09:46:38 -0700
commit9cd320ea6572c577cdf17ce1f9ea5230b166af6d (patch)
treed1c8e7c2e09a91ed75f0e5476c648c2e745aa2de /libgo/runtime
parent4854d721be78358e59367982bdd94461b4be3c5a (diff)
parent3175d40fc52fb8eb3c3b18cc343d773da24434fb (diff)
downloadgcc-9cd320ea6572c577cdf17ce1f9ea5230b166af6d.zip
gcc-9cd320ea6572c577cdf17ce1f9ea5230b166af6d.tar.gz
gcc-9cd320ea6572c577cdf17ce1f9ea5230b166af6d.tar.bz2
Merge from trunk revision 3175d40fc52fb8eb3c3b18cc343d773da24434fb.
Diffstat (limited to 'libgo/runtime')
-rw-r--r--libgo/runtime/go-varargs.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libgo/runtime/go-varargs.c b/libgo/runtime/go-varargs.c
index 2b186ef..9cb4a7e 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,18 @@ __go_syscall6(uintptr_t flag, uintptr_t a1, uintptr_t a2, uintptr_t a3,
}
#endif
+
+// AIX ptrace is really different from Linux ptrace. Let syscall
+// package handles it.
+#if defined(HAVE_SYS_PTRACE_H) && !defined(_AIX)
+
+// 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