if($libc) {
$extraimports = 'import "internal/abi"';
}
+if($darwin) {
+ $extraimports .= "\nimport \"runtime\"";
+}
sub parseparamlist($) {
my ($list) = @_;
# without reading the header.
$text .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n";
- if (($darwin && $func =~ /^ptrace1(Ptr)?$/) || (($openbsd && $libc) && $func =~ /^ptrace(Ptr)?$/)) {
+ if ((($darwin || ($openbsd && $libc)) && $func =~ /^ptrace(Ptr)?$/)) {
# The ptrace function is called from forkAndExecInChild where stack
# growth is forbidden.
$text .= "//go:nosplit\n"
my $out_decl = @out ? sprintf(" (%s)", join(', ', @out)) : "";
$text .= sprintf "func %s(%s)%s {\n", $func, join(', ', @in), $out_decl;
+ # Disable ptrace on iOS.
+ if ($darwin && $func =~ /^ptrace(Ptr)?$/) {
+ $text .= "\tif runtime.GOOS == \"ios\" {\n";
+ $text .= "\t\tpanic(\"unimplemented\")\n";
+ $text .= "\t}\n";
+ }
+
# Check if err return available
my $errvar = "";
foreach my $p (@out) {
+++ /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.
-
-//go: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.
-
-//go:build ios
-
-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 ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace
+//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
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 ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace
+//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
func SetKevent(k *Kevent_t, fd, mode, flags int) {
k.Ident = uint64(fd)
import "unsafe"
import "internal/abi"
+import "runtime"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
//go:nosplit
-func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) {
+func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
+ if runtime.GOOS == "ios" {
+ panic("unimplemented")
+ }
_, _, e1 := syscall6(abi.FuncPCABI0(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
import "unsafe"
import "internal/abi"
+import "runtime"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
//go:nosplit
-func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) {
+func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
+ if runtime.GOOS == "ios" {
+ panic("unimplemented")
+ }
_, _, e1 := syscall6(abi.FuncPCABI0(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 {
err = errnoErr(e1)