May fix #43302.
Change-Id: I6b7ddf94495c4fa80cf8a50a38eef5f8b2872669
Reviewed-on: https://go-review.googlesource.com/c/go/+/279481
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
# without reading the header.
$text .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n";
- if ($darwin && $func eq "ptrace") {
+ if ($darwin && $func eq "ptrace1") {
# The ptrace function is called from forkAndExecInChild where stack
# growth is forbidden.
$text .= "//go:nosplit\n"
--- /dev/null
+// Copyright 2020 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build !ios
+
+package syscall
+
+// Nosplit because it is called from forkAndExecInChild.
+//
+//go:nosplit
+func ptrace(request int, pid int, addr uintptr, data uintptr) error {
+ return ptrace1(request, pid, addr, data)
+}
--- /dev/null
+// Copyright 2020 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package syscall
+
+// Nosplit because it is called from forkAndExecInChild.
+//
+//go:nosplit
+func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
+ panic("unimplemented")
+}
//sys Stat(path string, stat *Stat_t) (err error) = SYS_stat64
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_statfs64
//sys fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_fstatat64
-//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
+//sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace
func SetKevent(k *Kevent_t, fd, mode, flags int) {
k.Ident = uint64(fd)
//sys Stat(path string, stat *Stat_t) (err error)
//sys Statfs(path string, stat *Statfs_t) (err error)
//sys fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
-//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
+//sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace
func SetKevent(k *Kevent_t, fd, mode, flags int) {
k.Ident = uint64(fd)
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
//go:nosplit
-func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
+func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) {
_, _, e1 := syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
//go:nosplit
-func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
+func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) {
_, _, e1 := syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 {
err = errnoErr(e1)