mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall: don't generate ptrace on iOS
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>
This commit is contained in:
parent
6cff874c47
commit
bc7e4d9257
7 changed files with 31 additions and 5 deletions
|
|
@ -125,7 +125,7 @@ while(<>) {
|
||||||
# without reading the header.
|
# without reading the header.
|
||||||
$text .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n";
|
$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
|
# The ptrace function is called from forkAndExecInChild where stack
|
||||||
# growth is forbidden.
|
# growth is forbidden.
|
||||||
$text .= "//go:nosplit\n"
|
$text .= "//go:nosplit\n"
|
||||||
|
|
|
||||||
14
src/syscall/ptrace_darwin.go
Normal file
14
src/syscall/ptrace_darwin.go
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
// 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)
|
||||||
|
}
|
||||||
12
src/syscall/ptrace_ios.go
Normal file
12
src/syscall/ptrace_ios.go
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
// 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")
|
||||||
|
}
|
||||||
|
|
@ -21,7 +21,7 @@ func setTimeval(sec, usec int64) Timeval {
|
||||||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_stat64
|
//sys Stat(path string, stat *Stat_t) (err error) = SYS_stat64
|
||||||
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_statfs64
|
//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 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) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
k.Ident = uint64(fd)
|
k.Ident = uint64(fd)
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ func setTimeval(sec, usec int64) Timeval {
|
||||||
//sys Stat(path string, stat *Stat_t) (err error)
|
//sys Stat(path string, stat *Stat_t) (err error)
|
||||||
//sys Statfs(path string, stat *Statfs_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 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) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
k.Ident = uint64(fd)
|
k.Ident = uint64(fd)
|
||||||
|
|
|
||||||
|
|
@ -2091,7 +2091,7 @@ func libc_fstatat64_trampoline()
|
||||||
// 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
|
//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)
|
_, _, e1 := syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
err = errnoErr(e1)
|
err = errnoErr(e1)
|
||||||
|
|
|
||||||
|
|
@ -2091,7 +2091,7 @@ func libc_fstatat_trampoline()
|
||||||
// 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
|
//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)
|
_, _, e1 := syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
err = errnoErr(e1)
|
err = errnoErr(e1)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue