diff options
author | Nikhil Benesch <nikhil.benesch@gmail.com> | 2020-10-18 19:28:54 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2020-10-21 22:29:04 -0700 |
commit | 439407aa2c678a96bd5b430ab9c335e65beb5751 (patch) | |
tree | 62868455b7c11523dfe8daaf93e178ecb7425167 /libgo/runtime | |
parent | d5d9706f95378d40a8895616e167614b69dfe70a (diff) | |
download | gcc-439407aa2c678a96bd5b430ab9c335e65beb5751.zip gcc-439407aa2c678a96bd5b430ab9c335e65beb5751.tar.gz gcc-439407aa2c678a96bd5b430ab9c335e65beb5751.tar.bz2 |
syscall: only compile ptrace varargs shim on Linux
Only compile the __go_ptrace varargs shim on Linux to avoid compilation
failures on some other platforms. The C ptrace function is not entirely
portable (e.g., NetBSD has `int data` instead of `void* data`), and so
far Linux is the only platform that needs the varargs shim.
Additionally, make the types in the ptrace and raw_ptrace function
declarations match. This makes it more clear that the only difference
between the two is that calls via the former are allowed to block while
calls via the latter are not.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/263517
Diffstat (limited to 'libgo/runtime')
-rw-r--r-- | libgo/runtime/go-varargs.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libgo/runtime/go-varargs.c b/libgo/runtime/go-varargs.c index d8f7dc5..f848608 100644 --- a/libgo/runtime/go-varargs.c +++ b/libgo/runtime/go-varargs.c @@ -114,12 +114,11 @@ __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) + +#if defined(HAVE_SYS_PTRACE_H) && defined(__linux__) // Despite documented appearances, this is actually implemented as -// a variadic function within glibc. +// a variadic function within glibc on Linux. long __go_ptrace(int request, pid_t pid, void *addr, void *data) |