mirror of
https://github.com/golang/go
synced 2024-11-12 09:20:22 -07:00
syscall: implement syscalls on Darwin using libSystem
There are still some references to the bare Syscall functions in the stdlib. I will root those out in a following CL. (This CL is big enough as it is.) Most are in vendor directories: cmd/vendor/golang.org/x/sys/unix/ vendor/golang_org/x/net/route/syscall.go syscall/bpf_bsd.go syscall/exec_unix.go syscall/flock.go Update #17490 Change-Id: I69ab707811530c26b652b291cadee92f5bf5c1a4 Reviewed-on: https://go-review.googlesource.com/c/141639 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Elias Naur <elias.naur@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
0fcd40503b
commit
a3b01440fe
@ -4704,7 +4704,9 @@ func (ab *AsmBuf) doasm(ctxt *obj.Link, cursym *obj.LSym, p *obj.Prog) {
|
||||
r = obj.Addrel(cursym)
|
||||
r.Off = int32(p.Pc + int64(ab.Len()))
|
||||
r.Sym = p.To.Sym
|
||||
r.Type = objabi.R_PCREL
|
||||
// Note: R_CALL instead of R_PCREL. R_CALL is more permissive in that
|
||||
// it can point to a trampoline instead of the destination itself.
|
||||
r.Type = objabi.R_CALL
|
||||
r.Siz = 4
|
||||
ab.PutInt32(0)
|
||||
break
|
||||
|
@ -4,7 +4,10 @@
|
||||
|
||||
package poll
|
||||
|
||||
import "syscall"
|
||||
import (
|
||||
"syscall"
|
||||
_ "unsafe" // for go:linkname
|
||||
)
|
||||
|
||||
// Fsync invokes SYS_FCNTL with SYS_FULLFSYNC because
|
||||
// on OS X, SYS_FSYNC doesn't fully flush contents to disk.
|
||||
@ -15,9 +18,10 @@ func (fd *FD) Fsync() error {
|
||||
}
|
||||
defer fd.decref()
|
||||
|
||||
_, _, e1 := syscall.Syscall(syscall.SYS_FCNTL, uintptr(fd.Sysfd), syscall.F_FULLFSYNC, 0)
|
||||
if e1 != 0 {
|
||||
return e1
|
||||
}
|
||||
return nil
|
||||
_, e1 := fcntl(fd.Sysfd, syscall.F_FULLFSYNC, 0)
|
||||
return e1
|
||||
}
|
||||
|
||||
// Implemented in syscall/syscall_darwin.go.
|
||||
//go:linkname fcntl syscall.fcntl
|
||||
func fcntl(fd int, cmd int, arg int) (int, error)
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build aix dragonfly freebsd js,wasm linux nacl netbsd openbsd solaris windows
|
||||
// +build aix dragonfly freebsd js,wasm linux nacl netbsd openbsd solaris
|
||||
|
||||
package poll
|
||||
|
||||
@ -16,3 +16,11 @@ func (fd *FD) Fsync() error {
|
||||
defer fd.decref()
|
||||
return syscall.Fsync(fd.Sysfd)
|
||||
}
|
||||
|
||||
func fcntl(fd int, cmd int, arg int) (int, error) {
|
||||
r, _, e := syscall.Syscall(syscall.SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
|
||||
if e != 0 {
|
||||
return int(r), syscall.Errno(e)
|
||||
}
|
||||
return int(r), nil
|
||||
}
|
||||
|
16
src/internal/poll/fd_fsync_windows.go
Normal file
16
src/internal/poll/fd_fsync_windows.go
Normal file
@ -0,0 +1,16 @@
|
||||
// Copyright 2018 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 poll
|
||||
|
||||
import "syscall"
|
||||
|
||||
// Fsync wraps syscall.Fsync.
|
||||
func (fd *FD) Fsync() error {
|
||||
if err := fd.incref(); err != nil {
|
||||
return err
|
||||
}
|
||||
defer fd.decref()
|
||||
return syscall.Fsync(fd.Sysfd)
|
||||
}
|
@ -452,10 +452,11 @@ var tryDupCloexec = int32(1)
|
||||
// DupCloseOnExec dups fd and marks it close-on-exec.
|
||||
func DupCloseOnExec(fd int) (int, string, error) {
|
||||
if atomic.LoadInt32(&tryDupCloexec) == 1 {
|
||||
r0, _, e1 := syscall.Syscall(syscall.SYS_FCNTL, uintptr(fd), syscall.F_DUPFD_CLOEXEC, 0)
|
||||
switch e1 {
|
||||
case 0:
|
||||
return int(r0), "", nil
|
||||
r0, e1 := fcntl(fd, syscall.F_DUPFD_CLOEXEC, 0)
|
||||
if e1 == nil {
|
||||
return r0, "", nil
|
||||
}
|
||||
switch e1.(syscall.Errno) {
|
||||
case syscall.EINVAL, syscall.ENOSYS:
|
||||
// Old kernel, or js/wasm (which returns
|
||||
// ENOSYS). Fall back to the portable way from
|
||||
|
16
src/internal/poll/fd_writev_darwin.go
Normal file
16
src/internal/poll/fd_writev_darwin.go
Normal file
@ -0,0 +1,16 @@
|
||||
// Copyright 2018 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 darwin
|
||||
|
||||
package poll
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
_ "unsafe" // for go:linkname
|
||||
)
|
||||
|
||||
// Implemented in syscall/syscall_darwin.go.
|
||||
//go:linkname writev syscall.writev
|
||||
func writev(fd int, iovecs []syscall.Iovec) (uintptr, error)
|
20
src/internal/poll/fd_writev_unix.go
Normal file
20
src/internal/poll/fd_writev_unix.go
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright 2018 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 dragonfly freebsd linux netbsd openbsd
|
||||
|
||||
package poll
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func writev(fd int, iovecs []syscall.Iovec) (uintptr, error) {
|
||||
r, _, e := syscall.Syscall(syscall.SYS_WRITEV, uintptr(fd), uintptr(unsafe.Pointer(&iovecs[0])), uintptr(len(iovecs)))
|
||||
if e != 0 {
|
||||
return r, syscall.Errno(e)
|
||||
}
|
||||
return r, nil
|
||||
}
|
@ -9,7 +9,6 @@ package poll
|
||||
import (
|
||||
"io"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// Writev wraps the writev system call.
|
||||
@ -54,24 +53,20 @@ func (fd *FD) Writev(v *[][]byte) (int64, error) {
|
||||
}
|
||||
fd.iovecs = &iovecs // cache
|
||||
|
||||
wrote, _, e0 := syscall.Syscall(syscall.SYS_WRITEV,
|
||||
uintptr(fd.Sysfd),
|
||||
uintptr(unsafe.Pointer(&iovecs[0])),
|
||||
uintptr(len(iovecs)))
|
||||
var wrote uintptr
|
||||
wrote, err = writev(fd.Sysfd, iovecs)
|
||||
if wrote == ^uintptr(0) {
|
||||
wrote = 0
|
||||
}
|
||||
TestHookDidWritev(int(wrote))
|
||||
n += int64(wrote)
|
||||
consume(v, int64(wrote))
|
||||
if e0 == syscall.EAGAIN {
|
||||
if err = fd.pd.waitWrite(fd.isFile); err == nil {
|
||||
continue
|
||||
}
|
||||
} else if e0 != 0 {
|
||||
err = syscall.Errno(e0)
|
||||
}
|
||||
if err != nil {
|
||||
if err.(syscall.Errno) == syscall.EAGAIN {
|
||||
if err = fd.pd.waitWrite(fd.isFile); err == nil {
|
||||
continue
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
if n == 0 {
|
||||
|
5
src/internal/syscall/unix/empty.s
Normal file
5
src/internal/syscall/unix/empty.s
Normal file
@ -0,0 +1,5 @@
|
||||
// Copyright 2018 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.
|
||||
|
||||
// This exists solely so we can linkname in symbols from syscall.
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
|
||||
// +build aix dragonfly freebsd linux netbsd openbsd solaris
|
||||
|
||||
package unix
|
||||
|
||||
|
24
src/internal/syscall/unix/nonblocking_darwin.go
Normal file
24
src/internal/syscall/unix/nonblocking_darwin.go
Normal file
@ -0,0 +1,24 @@
|
||||
// Copyright 2018 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 darwin
|
||||
|
||||
package unix
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
_ "unsafe" // for go:linkname
|
||||
)
|
||||
|
||||
func IsNonblock(fd int) (nonblocking bool, err error) {
|
||||
flag, e1 := fcntl(fd, syscall.F_GETFL, 0)
|
||||
if e1 != nil {
|
||||
return false, e1
|
||||
}
|
||||
return flag&syscall.O_NONBLOCK != 0, nil
|
||||
}
|
||||
|
||||
// Implemented in syscall/syscall_darwin.go.
|
||||
//go:linkname fcntl syscall.fcntl
|
||||
func fcntl(fd int, cmd int, arg int) (int, error)
|
@ -50,6 +50,61 @@ func libcCall(fn, arg unsafe.Pointer) int32 {
|
||||
return res
|
||||
}
|
||||
|
||||
// The X versions of syscall expect the libc call to return a 64-bit result.
|
||||
// Otherwise (the non-X version) expects a 32-bit result.
|
||||
// This distinction is required because an error is indicated by returning -1,
|
||||
// and we need to know whether to check 32 or 64 bits of the result.
|
||||
// (Some libc functions that return 32 bits put junk in the upper 32 bits of AX.)
|
||||
|
||||
//go:linkname syscall_syscall syscall.syscall
|
||||
//go:nosplit
|
||||
//go:cgo_unsafe_args
|
||||
func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2, err uintptr) {
|
||||
entersyscallblock()
|
||||
libcCall(unsafe.Pointer(funcPC(syscall)), unsafe.Pointer(&fn))
|
||||
exitsyscall()
|
||||
return
|
||||
}
|
||||
func syscall()
|
||||
|
||||
//go:linkname syscall_syscall6 syscall.syscall6
|
||||
//go:nosplit
|
||||
//go:cgo_unsafe_args
|
||||
func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) {
|
||||
entersyscallblock()
|
||||
libcCall(unsafe.Pointer(funcPC(syscall6)), unsafe.Pointer(&fn))
|
||||
exitsyscall()
|
||||
return
|
||||
}
|
||||
func syscall6()
|
||||
|
||||
//go:linkname syscall_syscall6X syscall.syscall6X
|
||||
//go:nosplit
|
||||
//go:cgo_unsafe_args
|
||||
func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) {
|
||||
entersyscallblock()
|
||||
libcCall(unsafe.Pointer(funcPC(syscall6X)), unsafe.Pointer(&fn))
|
||||
exitsyscall()
|
||||
return
|
||||
}
|
||||
func syscall6X()
|
||||
|
||||
//go:linkname syscall_rawSyscall syscall.rawSyscall
|
||||
//go:nosplit
|
||||
//go:cgo_unsafe_args
|
||||
func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2, err uintptr) {
|
||||
libcCall(unsafe.Pointer(funcPC(syscall)), unsafe.Pointer(&fn))
|
||||
return
|
||||
}
|
||||
|
||||
//go:linkname syscall_rawSyscall6 syscall.rawSyscall6
|
||||
//go:nosplit
|
||||
//go:cgo_unsafe_args
|
||||
func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) {
|
||||
libcCall(unsafe.Pointer(funcPC(syscall6)), unsafe.Pointer(&fn))
|
||||
return
|
||||
}
|
||||
|
||||
// The *_trampoline functions convert from the Go calling convention to the C calling convention
|
||||
// and then call the underlying libc function. They are defined in sys_darwin_$ARCH.s.
|
||||
|
||||
|
21
src/runtime/sys_darwin_32.go
Normal file
21
src/runtime/sys_darwin_32.go
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2018 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 darwin
|
||||
// +build 386 arm
|
||||
|
||||
package runtime
|
||||
|
||||
import "unsafe"
|
||||
|
||||
//go:linkname syscall_syscall9 syscall.syscall9
|
||||
//go:nosplit
|
||||
//go:cgo_unsafe_args
|
||||
func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, err uintptr) {
|
||||
entersyscallblock()
|
||||
libcCall(unsafe.Pointer(funcPC(syscall9)), unsafe.Pointer(&fn))
|
||||
exitsyscall()
|
||||
return
|
||||
}
|
||||
func syscall9()
|
@ -625,3 +625,237 @@ TEXT runtime·pthread_cond_signal_trampoline(SB),NOSPLIT,$0
|
||||
MOVL BP, SP
|
||||
POPL BP
|
||||
RET
|
||||
|
||||
// syscall calls a function in libc on behalf of the syscall package.
|
||||
// syscall takes a pointer to a struct like:
|
||||
// struct {
|
||||
// fn uintptr
|
||||
// a1 uintptr
|
||||
// a2 uintptr
|
||||
// a3 uintptr
|
||||
// r1 uintptr
|
||||
// r2 uintptr
|
||||
// err uintptr
|
||||
// }
|
||||
// syscall must be called on the g0 stack with the
|
||||
// C calling convention (use libcCall).
|
||||
TEXT runtime·syscall(SB),NOSPLIT,$0
|
||||
PUSHL BP
|
||||
MOVL SP, BP
|
||||
SUBL $24, SP
|
||||
MOVL 32(SP), CX
|
||||
MOVL (0*4)(CX), AX // fn
|
||||
MOVL (1*4)(CX), DX // a1
|
||||
MOVL DX, 0(SP)
|
||||
MOVL (2*4)(CX), DX // a2
|
||||
MOVL DX, 4(SP)
|
||||
MOVL (3*4)(CX), DX // a3
|
||||
MOVL DX, 8(SP)
|
||||
|
||||
CALL AX
|
||||
|
||||
MOVL 32(SP), CX
|
||||
MOVL AX, (4*4)(CX) // r1
|
||||
MOVL DX, (5*4)(CX) // r2
|
||||
|
||||
// Standard libc functions return -1 on error
|
||||
// and set errno.
|
||||
CMPL AX, $-1
|
||||
JNE ok
|
||||
|
||||
// Get error code from libc.
|
||||
CALL libc_error(SB)
|
||||
MOVL (AX), AX
|
||||
MOVL 32(SP), CX
|
||||
MOVL AX, (6*4)(CX) // err
|
||||
|
||||
ok:
|
||||
XORL AX, AX // no error (it's ignored anyway)
|
||||
MOVL BP, SP
|
||||
POPL BP
|
||||
RET
|
||||
|
||||
// syscall6 calls a function in libc on behalf of the syscall package.
|
||||
// syscall6 takes a pointer to a struct like:
|
||||
// struct {
|
||||
// fn uintptr
|
||||
// a1 uintptr
|
||||
// a2 uintptr
|
||||
// a3 uintptr
|
||||
// a4 uintptr
|
||||
// a5 uintptr
|
||||
// a6 uintptr
|
||||
// r1 uintptr
|
||||
// r2 uintptr
|
||||
// err uintptr
|
||||
// }
|
||||
// syscall6 must be called on the g0 stack with the
|
||||
// C calling convention (use libcCall).
|
||||
TEXT runtime·syscall6(SB),NOSPLIT,$0
|
||||
PUSHL BP
|
||||
MOVL SP, BP
|
||||
SUBL $24, SP
|
||||
MOVL 32(SP), CX
|
||||
MOVL (0*4)(CX), AX // fn
|
||||
MOVL (1*4)(CX), DX // a1
|
||||
MOVL DX, 0(SP)
|
||||
MOVL (2*4)(CX), DX // a2
|
||||
MOVL DX, 4(SP)
|
||||
MOVL (3*4)(CX), DX // a3
|
||||
MOVL DX, 8(SP)
|
||||
MOVL (4*4)(CX), DX // a4
|
||||
MOVL DX, 12(SP)
|
||||
MOVL (5*4)(CX), DX // a5
|
||||
MOVL DX, 16(SP)
|
||||
MOVL (6*4)(CX), DX // a6
|
||||
MOVL DX, 20(SP)
|
||||
|
||||
CALL AX
|
||||
|
||||
MOVL 32(SP), CX
|
||||
MOVL AX, (7*4)(CX) // r1
|
||||
MOVL DX, (8*4)(CX) // r2
|
||||
|
||||
// Standard libc functions return -1 on error
|
||||
// and set errno.
|
||||
CMPL AX, $-1
|
||||
JNE ok
|
||||
|
||||
// Get error code from libc.
|
||||
CALL libc_error(SB)
|
||||
MOVL (AX), AX
|
||||
MOVL 32(SP), CX
|
||||
MOVL AX, (9*4)(CX) // err
|
||||
|
||||
ok:
|
||||
XORL AX, AX // no error (it's ignored anyway)
|
||||
MOVL BP, SP
|
||||
POPL BP
|
||||
RET
|
||||
|
||||
// syscall6X calls a function in libc on behalf of the syscall package.
|
||||
// syscall6X takes a pointer to a struct like:
|
||||
// struct {
|
||||
// fn uintptr
|
||||
// a1 uintptr
|
||||
// a2 uintptr
|
||||
// a3 uintptr
|
||||
// a4 uintptr
|
||||
// a5 uintptr
|
||||
// a6 uintptr
|
||||
// r1 uintptr
|
||||
// r2 uintptr
|
||||
// err uintptr
|
||||
// }
|
||||
// syscall6X must be called on the g0 stack with the
|
||||
// C calling convention (use libcCall).
|
||||
TEXT runtime·syscall6X(SB),NOSPLIT,$0
|
||||
PUSHL BP
|
||||
MOVL SP, BP
|
||||
SUBL $24, SP
|
||||
MOVL 32(SP), CX
|
||||
MOVL (0*4)(CX), AX // fn
|
||||
MOVL (1*4)(CX), DX // a1
|
||||
MOVL DX, 0(SP)
|
||||
MOVL (2*4)(CX), DX // a2
|
||||
MOVL DX, 4(SP)
|
||||
MOVL (3*4)(CX), DX // a3
|
||||
MOVL DX, 8(SP)
|
||||
MOVL (4*4)(CX), DX // a4
|
||||
MOVL DX, 12(SP)
|
||||
MOVL (5*4)(CX), DX // a5
|
||||
MOVL DX, 16(SP)
|
||||
MOVL (6*4)(CX), DX // a6
|
||||
MOVL DX, 20(SP)
|
||||
|
||||
CALL AX
|
||||
|
||||
MOVL 32(SP), CX
|
||||
MOVL AX, (7*4)(CX) // r1
|
||||
MOVL DX, (8*4)(CX) // r2
|
||||
|
||||
// Standard libc functions return -1 on error
|
||||
// and set errno.
|
||||
CMPL AX, $-1
|
||||
JNE ok
|
||||
CMPL DX, $-1
|
||||
JNE ok
|
||||
|
||||
// Get error code from libc.
|
||||
CALL libc_error(SB)
|
||||
MOVL (AX), AX
|
||||
MOVL 32(SP), CX
|
||||
MOVL AX, (9*4)(CX) // err
|
||||
|
||||
ok:
|
||||
XORL AX, AX // no error (it's ignored anyway)
|
||||
MOVL BP, SP
|
||||
POPL BP
|
||||
RET
|
||||
|
||||
// syscall9 calls a function in libc on behalf of the syscall package.
|
||||
// syscall9 takes a pointer to a struct like:
|
||||
// struct {
|
||||
// fn uintptr
|
||||
// a1 uintptr
|
||||
// a2 uintptr
|
||||
// a3 uintptr
|
||||
// a4 uintptr
|
||||
// a5 uintptr
|
||||
// a6 uintptr
|
||||
// a7 uintptr
|
||||
// a8 uintptr
|
||||
// a9 uintptr
|
||||
// r1 uintptr
|
||||
// r2 uintptr
|
||||
// err uintptr
|
||||
// }
|
||||
// syscall9 must be called on the g0 stack with the
|
||||
// C calling convention (use libcCall).
|
||||
TEXT runtime·syscall9(SB),NOSPLIT,$0
|
||||
PUSHL BP
|
||||
MOVL SP, BP
|
||||
SUBL $40, SP
|
||||
MOVL 48(SP), CX
|
||||
MOVL (0*4)(CX), AX // fn
|
||||
MOVL (1*4)(CX), DX // a1
|
||||
MOVL DX, 0(SP)
|
||||
MOVL (2*4)(CX), DX // a2
|
||||
MOVL DX, 4(SP)
|
||||
MOVL (3*4)(CX), DX // a3
|
||||
MOVL DX, 8(SP)
|
||||
MOVL (4*4)(CX), DX // a4
|
||||
MOVL DX, 12(SP)
|
||||
MOVL (5*4)(CX), DX // a5
|
||||
MOVL DX, 16(SP)
|
||||
MOVL (6*4)(CX), DX // a6
|
||||
MOVL DX, 20(SP)
|
||||
MOVL (7*4)(CX), DX // a7
|
||||
MOVL DX, 24(SP)
|
||||
MOVL (8*4)(CX), DX // a8
|
||||
MOVL DX, 28(SP)
|
||||
MOVL (9*4)(CX), DX // a9
|
||||
MOVL DX, 32(SP)
|
||||
|
||||
CALL AX
|
||||
|
||||
MOVL 48(SP), CX
|
||||
MOVL AX, (10*4)(CX) // r1
|
||||
MOVL DX, (11*4)(CX) // r2
|
||||
|
||||
// Standard libc functions return -1 on error
|
||||
// and set errno.
|
||||
CMPL AX, $-1
|
||||
JNE ok
|
||||
|
||||
// Get error code from libc.
|
||||
CALL libc_error(SB)
|
||||
MOVL (AX), AX
|
||||
MOVL 48(SP), CX
|
||||
MOVL AX, (12*4)(CX) // err
|
||||
|
||||
ok:
|
||||
XORL AX, AX // no error (it's ignored anyway)
|
||||
MOVL BP, SP
|
||||
POPL BP
|
||||
RET
|
||||
|
21
src/runtime/sys_darwin_64.go
Normal file
21
src/runtime/sys_darwin_64.go
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2018 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 darwin
|
||||
// +build amd64 arm64
|
||||
|
||||
package runtime
|
||||
|
||||
import "unsafe"
|
||||
|
||||
//go:linkname syscall_syscallX syscall.syscallX
|
||||
//go:nosplit
|
||||
//go:cgo_unsafe_args
|
||||
func syscall_syscallX(fn, a1, a2, a3 uintptr) (r1, r2, err uintptr) {
|
||||
entersyscallblock()
|
||||
libcCall(unsafe.Pointer(funcPC(syscallX)), unsafe.Pointer(&fn))
|
||||
exitsyscall()
|
||||
return
|
||||
}
|
||||
func syscallX()
|
@ -26,6 +26,7 @@ TEXT runtime·open_trampoline(SB),NOSPLIT,$0
|
||||
MOVL 8(DI), SI // arg 2 flags
|
||||
MOVL 12(DI), DX // arg 3 mode
|
||||
MOVQ 0(DI), DI // arg 1 pathname
|
||||
XORL AX, AX // vararg: say "no float args"
|
||||
CALL libc_open(SB)
|
||||
POPQ BP
|
||||
RET
|
||||
@ -383,6 +384,7 @@ TEXT runtime·fcntl_trampoline(SB),NOSPLIT,$0
|
||||
MOVL 4(DI), SI // arg 2 cmd
|
||||
MOVL 8(DI), DX // arg 3 arg
|
||||
MOVL 0(DI), DI // arg 1 fd
|
||||
XORL AX, AX // vararg: say "no float args"
|
||||
CALL libc_fcntl(SB)
|
||||
POPQ BP
|
||||
RET
|
||||
@ -540,3 +542,197 @@ TEXT runtime·pthread_cond_signal_trampoline(SB),NOSPLIT,$0
|
||||
CALL libc_pthread_cond_signal(SB)
|
||||
POPQ BP
|
||||
RET
|
||||
|
||||
// syscall calls a function in libc on behalf of the syscall package.
|
||||
// syscall takes a pointer to a struct like:
|
||||
// struct {
|
||||
// fn uintptr
|
||||
// a1 uintptr
|
||||
// a2 uintptr
|
||||
// a3 uintptr
|
||||
// r1 uintptr
|
||||
// r2 uintptr
|
||||
// err uintptr
|
||||
// }
|
||||
// syscall must be called on the g0 stack with the
|
||||
// C calling convention (use libcCall).
|
||||
TEXT runtime·syscall(SB),NOSPLIT,$0
|
||||
PUSHQ BP
|
||||
MOVQ SP, BP
|
||||
SUBQ $16, SP
|
||||
MOVQ (0*8)(DI), CX // fn
|
||||
MOVQ (2*8)(DI), SI // a2
|
||||
MOVQ (3*8)(DI), DX // a3
|
||||
MOVQ DI, (SP)
|
||||
MOVQ (1*8)(DI), DI // a1
|
||||
XORL AX, AX // vararg: say "no float args"
|
||||
|
||||
CALL CX
|
||||
|
||||
MOVQ (SP), DI
|
||||
MOVQ AX, (4*8)(DI) // r1
|
||||
MOVQ DX, (5*8)(DI) // r2
|
||||
|
||||
// Standard libc functions return -1 on error
|
||||
// and set errno.
|
||||
CMPL AX, $-1 // Note: high 32 bits are junk
|
||||
JNE ok
|
||||
|
||||
// Get error code from libc.
|
||||
CALL libc_error(SB)
|
||||
MOVLQSX (AX), AX
|
||||
MOVQ (SP), DI
|
||||
MOVQ AX, (6*8)(DI) // err
|
||||
|
||||
ok:
|
||||
XORL AX, AX // no error (it's ignored anyway)
|
||||
MOVQ BP, SP
|
||||
POPQ BP
|
||||
RET
|
||||
|
||||
// syscallX calls a function in libc on behalf of the syscall package.
|
||||
// syscallX takes a pointer to a struct like:
|
||||
// struct {
|
||||
// fn uintptr
|
||||
// a1 uintptr
|
||||
// a2 uintptr
|
||||
// a3 uintptr
|
||||
// r1 uintptr
|
||||
// r2 uintptr
|
||||
// err uintptr
|
||||
// }
|
||||
// syscallX must be called on the g0 stack with the
|
||||
// C calling convention (use libcCall).
|
||||
TEXT runtime·syscallX(SB),NOSPLIT,$0
|
||||
PUSHQ BP
|
||||
MOVQ SP, BP
|
||||
SUBQ $16, SP
|
||||
MOVQ (0*8)(DI), CX // fn
|
||||
MOVQ (2*8)(DI), SI // a2
|
||||
MOVQ (3*8)(DI), DX // a3
|
||||
MOVQ DI, (SP)
|
||||
MOVQ (1*8)(DI), DI // a1
|
||||
XORL AX, AX // vararg: say "no float args"
|
||||
|
||||
CALL CX
|
||||
|
||||
MOVQ (SP), DI
|
||||
MOVQ AX, (4*8)(DI) // r1
|
||||
MOVQ DX, (5*8)(DI) // r2
|
||||
|
||||
// Standard libc functions return -1 on error
|
||||
// and set errno.
|
||||
CMPQ AX, $-1
|
||||
JNE ok
|
||||
|
||||
// Get error code from libc.
|
||||
CALL libc_error(SB)
|
||||
MOVLQSX (AX), AX
|
||||
MOVQ (SP), DI
|
||||
MOVQ AX, (6*8)(DI) // err
|
||||
|
||||
ok:
|
||||
XORL AX, AX // no error (it's ignored anyway)
|
||||
MOVQ BP, SP
|
||||
POPQ BP
|
||||
RET
|
||||
|
||||
// syscall6 calls a function in libc on behalf of the syscall package.
|
||||
// syscall6 takes a pointer to a struct like:
|
||||
// struct {
|
||||
// fn uintptr
|
||||
// a1 uintptr
|
||||
// a2 uintptr
|
||||
// a3 uintptr
|
||||
// a4 uintptr
|
||||
// a5 uintptr
|
||||
// a6 uintptr
|
||||
// r1 uintptr
|
||||
// r2 uintptr
|
||||
// err uintptr
|
||||
// }
|
||||
// syscall6 must be called on the g0 stack with the
|
||||
// C calling convention (use libcCall).
|
||||
TEXT runtime·syscall6(SB),NOSPLIT,$0
|
||||
PUSHQ BP
|
||||
MOVQ SP, BP
|
||||
SUBQ $16, SP
|
||||
MOVQ (0*8)(DI), R11// fn
|
||||
MOVQ (2*8)(DI), SI // a2
|
||||
MOVQ (3*8)(DI), DX // a3
|
||||
MOVQ (4*8)(DI), CX // a4
|
||||
MOVQ (5*8)(DI), R8 // a5
|
||||
MOVQ (6*8)(DI), R9 // a6
|
||||
MOVQ DI, (SP)
|
||||
MOVQ (1*8)(DI), DI // a1
|
||||
XORL AX, AX // vararg: say "no float args"
|
||||
|
||||
CALL R11
|
||||
|
||||
MOVQ (SP), DI
|
||||
MOVQ AX, (7*8)(DI) // r1
|
||||
MOVQ DX, (8*8)(DI) // r2
|
||||
|
||||
CMPL AX, $-1
|
||||
JNE ok
|
||||
|
||||
CALL libc_error(SB)
|
||||
MOVLQSX (AX), AX
|
||||
MOVQ (SP), DI
|
||||
MOVQ AX, (9*8)(DI) // err
|
||||
|
||||
ok:
|
||||
XORL AX, AX // no error (it's ignored anyway)
|
||||
MOVQ BP, SP
|
||||
POPQ BP
|
||||
RET
|
||||
|
||||
// syscall6X calls a function in libc on behalf of the syscall package.
|
||||
// syscall6X takes a pointer to a struct like:
|
||||
// struct {
|
||||
// fn uintptr
|
||||
// a1 uintptr
|
||||
// a2 uintptr
|
||||
// a3 uintptr
|
||||
// a4 uintptr
|
||||
// a5 uintptr
|
||||
// a6 uintptr
|
||||
// r1 uintptr
|
||||
// r2 uintptr
|
||||
// err uintptr
|
||||
// }
|
||||
// syscall6X must be called on the g0 stack with the
|
||||
// C calling convention (use libcCall).
|
||||
TEXT runtime·syscall6X(SB),NOSPLIT,$0
|
||||
PUSHQ BP
|
||||
MOVQ SP, BP
|
||||
SUBQ $16, SP
|
||||
MOVQ (0*8)(DI), R11// fn
|
||||
MOVQ (2*8)(DI), SI // a2
|
||||
MOVQ (3*8)(DI), DX // a3
|
||||
MOVQ (4*8)(DI), CX // a4
|
||||
MOVQ (5*8)(DI), R8 // a5
|
||||
MOVQ (6*8)(DI), R9 // a6
|
||||
MOVQ DI, (SP)
|
||||
MOVQ (1*8)(DI), DI // a1
|
||||
XORL AX, AX // vararg: say "no float args"
|
||||
|
||||
CALL R11
|
||||
|
||||
MOVQ (SP), DI
|
||||
MOVQ AX, (7*8)(DI) // r1
|
||||
MOVQ DX, (8*8)(DI) // r2
|
||||
|
||||
CMPQ AX, $-1
|
||||
JNE ok
|
||||
|
||||
CALL libc_error(SB)
|
||||
MOVLQSX (AX), AX
|
||||
MOVQ (SP), DI
|
||||
MOVQ AX, (9*8)(DI) // err
|
||||
|
||||
ok:
|
||||
XORL AX, AX // no error (it's ignored anyway)
|
||||
MOVQ BP, SP
|
||||
POPQ BP
|
||||
RET
|
||||
|
@ -382,3 +382,177 @@ TEXT runtime·pthread_cond_signal_trampoline(SB),NOSPLIT,$0
|
||||
MOVW 0(R0), R0 // arg 1 cond
|
||||
BL libc_pthread_cond_signal(SB)
|
||||
RET
|
||||
|
||||
// syscall calls a function in libc on behalf of the syscall package.
|
||||
// syscall takes a pointer to a struct like:
|
||||
// struct {
|
||||
// fn uintptr
|
||||
// a1 uintptr
|
||||
// a2 uintptr
|
||||
// a3 uintptr
|
||||
// r1 uintptr
|
||||
// r2 uintptr
|
||||
// err uintptr
|
||||
// }
|
||||
// syscall must be called on the g0 stack with the
|
||||
// C calling convention (use libcCall).
|
||||
TEXT runtime·syscall(SB),NOSPLIT,$0
|
||||
MOVW.W R0, -4(R13) // push structure pointer
|
||||
MOVW 0(R0), R12 // fn
|
||||
MOVW 8(R0), R1 // a2
|
||||
MOVW 12(R0), R2 // a3
|
||||
MOVW 4(R0), R0 // a1
|
||||
BL (R12)
|
||||
MOVW.P 4(R13), R2 // pop structure pointer
|
||||
MOVW R0, 16(R2) // save r1
|
||||
MOVW R1, 20(R2) // save r2
|
||||
MOVW $-1, R3
|
||||
CMP R0, R3
|
||||
BNE ok
|
||||
MOVW.W R2, -4(R13) // push structure pointer
|
||||
BL libc_error(SB)
|
||||
MOVW (R0), R0
|
||||
MOVW.P 4(R13), R2 // pop structure pointer
|
||||
MOVW R0, 24(R2) // save err
|
||||
ok:
|
||||
RET
|
||||
|
||||
// syscall6 calls a function in libc on behalf of the syscall package.
|
||||
// syscall6 takes a pointer to a struct like:
|
||||
// struct {
|
||||
// fn uintptr
|
||||
// a1 uintptr
|
||||
// a2 uintptr
|
||||
// a3 uintptr
|
||||
// a4 uintptr
|
||||
// a5 uintptr
|
||||
// a6 uintptr
|
||||
// r1 uintptr
|
||||
// r2 uintptr
|
||||
// err uintptr
|
||||
// }
|
||||
// syscall6 must be called on the g0 stack with the
|
||||
// C calling convention (use libcCall).
|
||||
TEXT runtime·syscall6(SB),NOSPLIT,$0
|
||||
MOVW.W R0, -4(R13) // push structure pointer
|
||||
MOVW 0(R0), R12 // fn
|
||||
MOVW 24(R0), R1 // a6
|
||||
MOVW.W R1, -4(R13)
|
||||
MOVW 20(R0), R1 // a5
|
||||
MOVW.W R1, -4(R13)
|
||||
MOVW 8(R0), R1 // a2
|
||||
MOVW 12(R0), R2 // a3
|
||||
MOVW 16(R0), R3 // a4
|
||||
MOVW 4(R0), R0 // a1
|
||||
BL (R12)
|
||||
ADD $8, R13
|
||||
MOVW.P 4(R13), R2 // pop structure pointer
|
||||
MOVW R0, 28(R2) // save r1
|
||||
MOVW R1, 32(R2) // save r2
|
||||
MOVW $-1, R3
|
||||
CMP R0, R3
|
||||
BNE ok
|
||||
MOVW.W R2, -4(R13) // push structure pointer
|
||||
BL libc_error(SB)
|
||||
MOVW (R0), R0
|
||||
MOVW.P 4(R13), R2 // pop structure pointer
|
||||
MOVW R0, 36(R2) // save err
|
||||
ok:
|
||||
RET
|
||||
|
||||
// syscall6X calls a function in libc on behalf of the syscall package.
|
||||
// syscall6X takes a pointer to a struct like:
|
||||
// struct {
|
||||
// fn uintptr
|
||||
// a1 uintptr
|
||||
// a2 uintptr
|
||||
// a3 uintptr
|
||||
// a4 uintptr
|
||||
// a5 uintptr
|
||||
// a6 uintptr
|
||||
// r1 uintptr
|
||||
// r2 uintptr
|
||||
// err uintptr
|
||||
// }
|
||||
// syscall6X must be called on the g0 stack with the
|
||||
// C calling convention (use libcCall).
|
||||
TEXT runtime·syscall6X(SB),NOSPLIT,$0
|
||||
MOVW.W R0, -4(R13) // push structure pointer
|
||||
MOVW 0(R0), R12 // fn
|
||||
MOVW 24(R0), R1 // a6
|
||||
MOVW.W R1, -4(R13)
|
||||
MOVW 20(R0), R1 // a5
|
||||
MOVW.W R1, -4(R13)
|
||||
MOVW 8(R0), R1 // a2
|
||||
MOVW 12(R0), R2 // a3
|
||||
MOVW 16(R0), R3 // a4
|
||||
MOVW 4(R0), R0 // a1
|
||||
BL (R12)
|
||||
ADD $8, R13
|
||||
MOVW.P 4(R13), R2 // pop structure pointer
|
||||
MOVW R0, 28(R2) // save r1
|
||||
MOVW R1, 32(R2) // save r2
|
||||
MOVW $-1, R3
|
||||
CMP R0, R3
|
||||
BNE ok
|
||||
CMP R1, R3
|
||||
BNE ok
|
||||
MOVW.W R2, -4(R13) // push structure pointer
|
||||
BL libc_error(SB)
|
||||
MOVW (R0), R0
|
||||
MOVW.P 4(R13), R2 // pop structure pointer
|
||||
MOVW R0, 36(R2) // save err
|
||||
ok:
|
||||
RET
|
||||
|
||||
// syscall9 calls a function in libc on behalf of the syscall package.
|
||||
// syscall9 takes a pointer to a struct like:
|
||||
// struct {
|
||||
// fn uintptr
|
||||
// a1 uintptr
|
||||
// a2 uintptr
|
||||
// a3 uintptr
|
||||
// a4 uintptr
|
||||
// a5 uintptr
|
||||
// a6 uintptr
|
||||
// a7 uintptr
|
||||
// a8 uintptr
|
||||
// a9 uintptr
|
||||
// r1 uintptr
|
||||
// r2 uintptr
|
||||
// err uintptr
|
||||
// }
|
||||
// syscall9 must be called on the g0 stack with the
|
||||
// C calling convention (use libcCall).
|
||||
TEXT runtime·syscall9(SB),NOSPLIT,$0
|
||||
MOVW.W R0, -4(R13) // push structure pointer
|
||||
MOVW 0(R0), R12 // fn
|
||||
MOVW 36(R0), R1 // a9
|
||||
MOVW.W R1, -4(R13)
|
||||
MOVW 32(R0), R1 // a8
|
||||
MOVW.W R1, -4(R13)
|
||||
MOVW 28(R0), R1 // a7
|
||||
MOVW.W R1, -4(R13)
|
||||
MOVW 24(R0), R1 // a6
|
||||
MOVW.W R1, -4(R13)
|
||||
MOVW 20(R0), R1 // a5
|
||||
MOVW.W R1, -4(R13)
|
||||
MOVW 8(R0), R1 // a2
|
||||
MOVW 12(R0), R2 // a3
|
||||
MOVW 16(R0), R3 // a4
|
||||
MOVW 4(R0), R0 // a1
|
||||
BL (R12)
|
||||
ADD $20, R13
|
||||
MOVW.P 4(R13), R2 // pop structure pointer
|
||||
MOVW R0, 40(R2) // save r1
|
||||
MOVW R1, 44(R2) // save r2
|
||||
MOVW $-1, R3
|
||||
CMP R0, R3
|
||||
BNE ok
|
||||
MOVW.W R2, -4(R13) // push structure pointer
|
||||
BL libc_error(SB)
|
||||
MOVW (R0), R0
|
||||
MOVW.P 4(R13), R2 // pop structure pointer
|
||||
MOVW R0, 48(R2) // save err
|
||||
ok:
|
||||
RET
|
||||
|
@ -16,10 +16,13 @@ TEXT notok<>(SB),NOSPLIT,$0
|
||||
B 0(PC)
|
||||
|
||||
TEXT runtime·open_trampoline(SB),NOSPLIT,$0
|
||||
SUB $16, RSP
|
||||
MOVW 8(R0), R1 // arg 2 flags
|
||||
MOVW 12(R0), R2 // arg 3 mode
|
||||
MOVW R2, (RSP) // arg 3 is variadic, pass on stack
|
||||
MOVD 0(R0), R0 // arg 1 pathname
|
||||
BL libc_open(SB)
|
||||
BL libc_open(SB)
|
||||
ADD $16, RSP
|
||||
RET
|
||||
|
||||
TEXT runtime·close_trampoline(SB),NOSPLIT,$0
|
||||
@ -283,10 +286,13 @@ ok:
|
||||
RET
|
||||
|
||||
TEXT runtime·fcntl_trampoline(SB),NOSPLIT,$0
|
||||
SUB $16, RSP
|
||||
MOVW 4(R0), R1 // arg 2 cmd
|
||||
MOVW 8(R0), R2 // arg 3 arg
|
||||
MOVW R2, (RSP) // arg 3 is variadic, pass on stack
|
||||
MOVW 0(R0), R0 // arg 1 fd
|
||||
BL libc_fcntl(SB)
|
||||
ADD $16, RSP
|
||||
RET
|
||||
|
||||
// sigaltstack on iOS is not supported and will always
|
||||
@ -372,3 +378,179 @@ TEXT runtime·pthread_cond_signal_trampoline(SB),NOSPLIT,$0
|
||||
BL libc_pthread_cond_signal(SB)
|
||||
RET
|
||||
|
||||
// syscall calls a function in libc on behalf of the syscall package.
|
||||
// syscall takes a pointer to a struct like:
|
||||
// struct {
|
||||
// fn uintptr
|
||||
// a1 uintptr
|
||||
// a2 uintptr
|
||||
// a3 uintptr
|
||||
// r1 uintptr
|
||||
// r2 uintptr
|
||||
// err uintptr
|
||||
// }
|
||||
// syscall must be called on the g0 stack with the
|
||||
// C calling convention (use libcCall).
|
||||
TEXT runtime·syscall(SB),NOSPLIT,$0
|
||||
SUB $16, RSP // push structure pointer
|
||||
MOVD R0, 8(RSP)
|
||||
|
||||
MOVD 0(R0), R12 // fn
|
||||
MOVD 16(R0), R1 // a2
|
||||
MOVD 24(R0), R2 // a3
|
||||
MOVD 8(R0), R0 // a1
|
||||
|
||||
// If fn is declared as vararg, we have to pass the vararg arguments on the stack.
|
||||
// (Because ios decided not to adhere to the standard arm64 calling convention, sigh...)
|
||||
// The only libSystem calls we support that are vararg are open, fcntl, and ioctl,
|
||||
// which are all of the form fn(x, y, ...). So we just need to put the 3rd arg
|
||||
// on the stack as well.
|
||||
// If we ever have other vararg libSystem calls, we might need to handle more cases.
|
||||
MOVD R2, (RSP)
|
||||
|
||||
BL (R12)
|
||||
|
||||
MOVD 8(RSP), R2 // pop structure pointer
|
||||
ADD $16, RSP
|
||||
MOVD R0, 32(R2) // save r1
|
||||
MOVD R1, 40(R2) // save r2
|
||||
CMPW $-1, R0
|
||||
BNE ok
|
||||
SUB $16, RSP // push structure pointer
|
||||
MOVD R2, 8(RSP)
|
||||
BL libc_error(SB)
|
||||
MOVW (R0), R0
|
||||
MOVD 8(RSP), R2 // pop structure pointer
|
||||
ADD $16, RSP
|
||||
MOVD R0, 48(R2) // save err
|
||||
ok:
|
||||
RET
|
||||
|
||||
// syscallX calls a function in libc on behalf of the syscall package.
|
||||
// syscallX takes a pointer to a struct like:
|
||||
// struct {
|
||||
// fn uintptr
|
||||
// a1 uintptr
|
||||
// a2 uintptr
|
||||
// a3 uintptr
|
||||
// r1 uintptr
|
||||
// r2 uintptr
|
||||
// err uintptr
|
||||
// }
|
||||
// syscallX must be called on the g0 stack with the
|
||||
// C calling convention (use libcCall).
|
||||
TEXT runtime·syscallX(SB),NOSPLIT,$0
|
||||
SUB $16, RSP // push structure pointer
|
||||
MOVD R0, (RSP)
|
||||
|
||||
MOVD 0(R0), R12 // fn
|
||||
MOVD 16(R0), R1 // a2
|
||||
MOVD 24(R0), R2 // a3
|
||||
MOVD 8(R0), R0 // a1
|
||||
BL (R12)
|
||||
|
||||
MOVD (RSP), R2 // pop structure pointer
|
||||
ADD $16, RSP
|
||||
MOVD R0, 32(R2) // save r1
|
||||
MOVD R1, 40(R2) // save r2
|
||||
CMP $-1, R0
|
||||
BNE ok
|
||||
SUB $16, RSP // push structure pointer
|
||||
MOVD R2, (RSP)
|
||||
BL libc_error(SB)
|
||||
MOVW (R0), R0
|
||||
MOVD (RSP), R2 // pop structure pointer
|
||||
ADD $16, RSP
|
||||
MOVD R0, 48(R2) // save err
|
||||
ok:
|
||||
RET
|
||||
|
||||
// syscall6 calls a function in libc on behalf of the syscall package.
|
||||
// syscall6 takes a pointer to a struct like:
|
||||
// struct {
|
||||
// fn uintptr
|
||||
// a1 uintptr
|
||||
// a2 uintptr
|
||||
// a3 uintptr
|
||||
// a4 uintptr
|
||||
// a5 uintptr
|
||||
// a6 uintptr
|
||||
// r1 uintptr
|
||||
// r2 uintptr
|
||||
// err uintptr
|
||||
// }
|
||||
// syscall6 must be called on the g0 stack with the
|
||||
// C calling convention (use libcCall).
|
||||
TEXT runtime·syscall6(SB),NOSPLIT,$0
|
||||
SUB $16, RSP // push structure pointer
|
||||
MOVD R0, (RSP)
|
||||
|
||||
MOVD 0(R0), R12 // fn
|
||||
MOVD 16(R0), R1 // a2
|
||||
MOVD 24(R0), R2 // a3
|
||||
MOVD 32(R0), R3 // a4
|
||||
MOVD 40(R0), R4 // a5
|
||||
MOVD 48(R0), R5 // a6
|
||||
MOVD 8(R0), R0 // a1
|
||||
BL (R12)
|
||||
|
||||
MOVD (RSP), R2 // pop structure pointer
|
||||
ADD $16, RSP
|
||||
MOVD R0, 56(R2) // save r1
|
||||
MOVD R1, 64(R2) // save r2
|
||||
CMPW $-1, R0
|
||||
BNE ok
|
||||
SUB $16, RSP // push structure pointer
|
||||
MOVD R2, (RSP)
|
||||
BL libc_error(SB)
|
||||
MOVW (R0), R0
|
||||
MOVD (RSP), R2 // pop structure pointer
|
||||
ADD $16, RSP
|
||||
MOVD R0, 72(R2) // save err
|
||||
ok:
|
||||
RET
|
||||
|
||||
// syscall6X calls a function in libc on behalf of the syscall package.
|
||||
// syscall6X takes a pointer to a struct like:
|
||||
// struct {
|
||||
// fn uintptr
|
||||
// a1 uintptr
|
||||
// a2 uintptr
|
||||
// a3 uintptr
|
||||
// a4 uintptr
|
||||
// a5 uintptr
|
||||
// a6 uintptr
|
||||
// r1 uintptr
|
||||
// r2 uintptr
|
||||
// err uintptr
|
||||
// }
|
||||
// syscall6X must be called on the g0 stack with the
|
||||
// C calling convention (use libcCall).
|
||||
TEXT runtime·syscall6X(SB),NOSPLIT,$0
|
||||
SUB $16, RSP // push structure pointer
|
||||
MOVD R0, (RSP)
|
||||
|
||||
MOVD 0(R0), R12 // fn
|
||||
MOVD 16(R0), R1 // a2
|
||||
MOVD 24(R0), R2 // a3
|
||||
MOVD 32(R0), R3 // a4
|
||||
MOVD 40(R0), R4 // a5
|
||||
MOVD 48(R0), R5 // a6
|
||||
MOVD 8(R0), R0 // a1
|
||||
BL (R12)
|
||||
|
||||
MOVD (RSP), R2 // pop structure pointer
|
||||
ADD $16, RSP
|
||||
MOVD R0, 56(R2) // save r1
|
||||
MOVD R1, 64(R2) // save r2
|
||||
CMP $-1, R0
|
||||
BNE ok
|
||||
SUB $16, RSP // push structure pointer
|
||||
MOVD R2, (RSP)
|
||||
BL libc_error(SB)
|
||||
MOVW (R0), R0
|
||||
MOVD (RSP), R2 // pop structure pointer
|
||||
ADD $16, RSP
|
||||
MOVD R0, 72(R2) // save err
|
||||
ok:
|
||||
RET
|
||||
|
@ -2,12 +2,11 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build darwin dragonfly freebsd netbsd openbsd
|
||||
// +build dragonfly freebsd netbsd openbsd
|
||||
|
||||
package syscall
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
@ -43,7 +42,7 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
|
||||
// Declare all variables at top in case any
|
||||
// declarations require heap allocation (e.g., err1).
|
||||
var (
|
||||
r1, r2 uintptr
|
||||
r1 uintptr
|
||||
err1 Errno
|
||||
nextfd int
|
||||
i int
|
||||
@ -62,25 +61,15 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
|
||||
}
|
||||
nextfd++
|
||||
|
||||
darwin := runtime.GOOS == "darwin"
|
||||
|
||||
// About to call fork.
|
||||
// No more allocation or calls of non-assembly functions.
|
||||
runtime_BeforeFork()
|
||||
r1, r2, err1 = RawSyscall(SYS_FORK, 0, 0, 0)
|
||||
r1, _, err1 = RawSyscall(SYS_FORK, 0, 0, 0)
|
||||
if err1 != 0 {
|
||||
runtime_AfterFork()
|
||||
return 0, err1
|
||||
}
|
||||
|
||||
// On Darwin:
|
||||
// r1 = child pid in both parent and child.
|
||||
// r2 = 0 in parent, 1 in child.
|
||||
// Convert to normal Unix r1 = 0 in child.
|
||||
if darwin && r2 == 1 {
|
||||
r1 = 0
|
||||
}
|
||||
|
||||
if r1 != 0 {
|
||||
// parent; return PID
|
||||
runtime_AfterFork()
|
||||
|
248
src/syscall/exec_darwin.go
Normal file
248
src/syscall/exec_darwin.go
Normal file
@ -0,0 +1,248 @@
|
||||
// Copyright 2011 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
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
type SysProcAttr struct {
|
||||
Chroot string // Chroot.
|
||||
Credential *Credential // Credential.
|
||||
Ptrace bool // Enable tracing.
|
||||
Setsid bool // Create session.
|
||||
Setpgid bool // Set process group ID to Pgid, or, if Pgid == 0, to new pid.
|
||||
Setctty bool // Set controlling terminal to fd Ctty
|
||||
Noctty bool // Detach fd 0 from controlling terminal
|
||||
Ctty int // Controlling TTY fd
|
||||
Foreground bool // Place child's process group in foreground. (Implies Setpgid. Uses Ctty as fd of controlling TTY)
|
||||
Pgid int // Child's process group ID if Setpgid.
|
||||
}
|
||||
|
||||
// Implemented in runtime package.
|
||||
func runtime_BeforeFork()
|
||||
func runtime_AfterFork()
|
||||
func runtime_AfterForkInChild()
|
||||
|
||||
// Fork, dup fd onto 0..len(fd), and exec(argv0, argvv, envv) in child.
|
||||
// If a dup or exec fails, write the errno error to pipe.
|
||||
// (Pipe is close-on-exec so if exec succeeds, it will be closed.)
|
||||
// In the child, this function must not acquire any locks, because
|
||||
// they might have been locked at the time of the fork. This means
|
||||
// no rescheduling, no malloc calls, and no new stack segments.
|
||||
// For the same reason compiler does not race instrument it.
|
||||
// The calls to rawSyscall are okay because they are assembly
|
||||
// functions that do not grow the stack.
|
||||
//go:norace
|
||||
func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr *ProcAttr, sys *SysProcAttr, pipe int) (pid int, err Errno) {
|
||||
// Declare all variables at top in case any
|
||||
// declarations require heap allocation (e.g., err1).
|
||||
var (
|
||||
r1 uintptr
|
||||
err1 Errno
|
||||
nextfd int
|
||||
i int
|
||||
)
|
||||
|
||||
// guard against side effects of shuffling fds below.
|
||||
// Make sure that nextfd is beyond any currently open files so
|
||||
// that we can't run the risk of overwriting any of them.
|
||||
fd := make([]int, len(attr.Files))
|
||||
nextfd = len(attr.Files)
|
||||
for i, ufd := range attr.Files {
|
||||
if nextfd < int(ufd) {
|
||||
nextfd = int(ufd)
|
||||
}
|
||||
fd[i] = int(ufd)
|
||||
}
|
||||
nextfd++
|
||||
|
||||
// About to call fork.
|
||||
// No more allocation or calls of non-assembly functions.
|
||||
runtime_BeforeFork()
|
||||
r1, _, err1 = rawSyscall(funcPC(libc_fork_trampoline), 0, 0, 0)
|
||||
if err1 != 0 {
|
||||
runtime_AfterFork()
|
||||
return 0, err1
|
||||
}
|
||||
|
||||
if r1 != 0 {
|
||||
// parent; return PID
|
||||
runtime_AfterFork()
|
||||
return int(r1), 0
|
||||
}
|
||||
|
||||
// Fork succeeded, now in child.
|
||||
|
||||
runtime_AfterForkInChild()
|
||||
|
||||
// Enable tracing if requested.
|
||||
if sys.Ptrace {
|
||||
_, _, err1 = rawSyscall(funcPC(libc_ptrace_trampoline), uintptr(PTRACE_TRACEME), 0, 0)
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
}
|
||||
|
||||
// Session ID
|
||||
if sys.Setsid {
|
||||
_, _, err1 = rawSyscall(funcPC(libc_setsid_trampoline), 0, 0, 0)
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
}
|
||||
|
||||
// Set process group
|
||||
if sys.Setpgid || sys.Foreground {
|
||||
// Place child in process group.
|
||||
_, _, err1 = rawSyscall(funcPC(libc_setpgid_trampoline), 0, uintptr(sys.Pgid), 0)
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
}
|
||||
|
||||
if sys.Foreground {
|
||||
pgrp := sys.Pgid
|
||||
if pgrp == 0 {
|
||||
r1, _, err1 = rawSyscall(funcPC(libc_getpid_trampoline), 0, 0, 0)
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
|
||||
pgrp = int(r1)
|
||||
}
|
||||
|
||||
// Place process group in foreground.
|
||||
_, _, err1 = rawSyscall(funcPC(libc_ioctl_trampoline), uintptr(sys.Ctty), uintptr(TIOCSPGRP), uintptr(unsafe.Pointer(&pgrp)))
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
}
|
||||
|
||||
// Chroot
|
||||
if chroot != nil {
|
||||
_, _, err1 = rawSyscall(funcPC(libc_chroot_trampoline), uintptr(unsafe.Pointer(chroot)), 0, 0)
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
}
|
||||
|
||||
// User and groups
|
||||
if cred := sys.Credential; cred != nil {
|
||||
ngroups := uintptr(len(cred.Groups))
|
||||
groups := uintptr(0)
|
||||
if ngroups > 0 {
|
||||
groups = uintptr(unsafe.Pointer(&cred.Groups[0]))
|
||||
}
|
||||
if !cred.NoSetGroups {
|
||||
_, _, err1 = rawSyscall(funcPC(libc_setgroups_trampoline), ngroups, groups, 0)
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
}
|
||||
_, _, err1 = rawSyscall(funcPC(libc_setgid_trampoline), uintptr(cred.Gid), 0, 0)
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
_, _, err1 = rawSyscall(funcPC(libc_setuid_trampoline), uintptr(cred.Uid), 0, 0)
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
}
|
||||
|
||||
// Chdir
|
||||
if dir != nil {
|
||||
_, _, err1 = rawSyscall(funcPC(libc_chdir_trampoline), uintptr(unsafe.Pointer(dir)), 0, 0)
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
}
|
||||
|
||||
// Pass 1: look for fd[i] < i and move those up above len(fd)
|
||||
// so that pass 2 won't stomp on an fd it needs later.
|
||||
if pipe < nextfd {
|
||||
_, _, err1 = rawSyscall(funcPC(libc_dup2_trampoline), uintptr(pipe), uintptr(nextfd), 0)
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
rawSyscall(funcPC(libc_fcntl_trampoline), uintptr(nextfd), F_SETFD, FD_CLOEXEC)
|
||||
pipe = nextfd
|
||||
nextfd++
|
||||
}
|
||||
for i = 0; i < len(fd); i++ {
|
||||
if fd[i] >= 0 && fd[i] < int(i) {
|
||||
if nextfd == pipe { // don't stomp on pipe
|
||||
nextfd++
|
||||
}
|
||||
_, _, err1 = rawSyscall(funcPC(libc_dup2_trampoline), uintptr(fd[i]), uintptr(nextfd), 0)
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
rawSyscall(funcPC(libc_fcntl_trampoline), uintptr(nextfd), F_SETFD, FD_CLOEXEC)
|
||||
fd[i] = nextfd
|
||||
nextfd++
|
||||
}
|
||||
}
|
||||
|
||||
// Pass 2: dup fd[i] down onto i.
|
||||
for i = 0; i < len(fd); i++ {
|
||||
if fd[i] == -1 {
|
||||
rawSyscall(funcPC(libc_close_trampoline), uintptr(i), 0, 0)
|
||||
continue
|
||||
}
|
||||
if fd[i] == int(i) {
|
||||
// dup2(i, i) won't clear close-on-exec flag on Linux,
|
||||
// probably not elsewhere either.
|
||||
_, _, err1 = rawSyscall(funcPC(libc_fcntl_trampoline), uintptr(fd[i]), F_SETFD, 0)
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
continue
|
||||
}
|
||||
// The new fd is created NOT close-on-exec,
|
||||
// which is exactly what we want.
|
||||
_, _, err1 = rawSyscall(funcPC(libc_dup2_trampoline), uintptr(fd[i]), uintptr(i), 0)
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
}
|
||||
|
||||
// By convention, we don't close-on-exec the fds we are
|
||||
// started with, so if len(fd) < 3, close 0, 1, 2 as needed.
|
||||
// Programs that know they inherit fds >= 3 will need
|
||||
// to set them close-on-exec.
|
||||
for i = len(fd); i < 3; i++ {
|
||||
rawSyscall(funcPC(libc_close_trampoline), uintptr(i), 0, 0)
|
||||
}
|
||||
|
||||
// Detach fd 0 from tty
|
||||
if sys.Noctty {
|
||||
_, _, err1 = rawSyscall(funcPC(libc_ioctl_trampoline), 0, uintptr(TIOCNOTTY), 0)
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
}
|
||||
|
||||
// Set the controlling TTY to Ctty
|
||||
if sys.Setctty {
|
||||
_, _, err1 = rawSyscall(funcPC(libc_ioctl_trampoline), uintptr(sys.Ctty), uintptr(TIOCSCTTY), 0)
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
}
|
||||
|
||||
// Time to exec.
|
||||
_, _, err1 = rawSyscall(funcPC(libc_execve_trampoline),
|
||||
uintptr(unsafe.Pointer(argv0)),
|
||||
uintptr(unsafe.Pointer(&argv[0])),
|
||||
uintptr(unsafe.Pointer(&envv[0])))
|
||||
|
||||
childerror:
|
||||
// send error code on pipe
|
||||
rawSyscall(funcPC(libc_write_trampoline), uintptr(pipe), uintptr(unsafe.Pointer(&err1)), unsafe.Sizeof(err1))
|
||||
for {
|
||||
rawSyscall(funcPC(libc_exit_trampoline), 253, 0, 0)
|
||||
}
|
||||
}
|
@ -83,6 +83,7 @@ mksysctl=""
|
||||
zsysctl="zsysctl_$GOOSARCH.go"
|
||||
mksysnum=
|
||||
mktypes=
|
||||
mkasm=
|
||||
run="sh"
|
||||
|
||||
case "$1" in
|
||||
@ -122,19 +123,31 @@ aix_ppc64)
|
||||
;;
|
||||
darwin_386)
|
||||
mkerrors="$mkerrors -m32"
|
||||
mksyscall="./mksyscall.pl -l32"
|
||||
mksyscall="./mksyscall.pl -l32 -darwin"
|
||||
mksysnum="./mksysnum_darwin.pl /usr/include/sys/syscall.h"
|
||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
||||
mkasm="go run mkasm_darwin.go"
|
||||
;;
|
||||
darwin_amd64)
|
||||
mkerrors="$mkerrors -m64"
|
||||
mksyscall="./mksyscall.pl -darwin"
|
||||
mksysnum="./mksysnum_darwin.pl /usr/include/sys/syscall.h"
|
||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
||||
mkasm="go run mkasm_darwin.go"
|
||||
;;
|
||||
darwin_arm64)
|
||||
mkerrors="$mkerrors -m64"
|
||||
mksyscall="./mksyscall.pl -darwin"
|
||||
mksysnum="./mksysnum_darwin.pl /usr/include/sys/syscall.h"
|
||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
||||
mkasm="go run mkasm_darwin.go"
|
||||
;;
|
||||
darwin_arm)
|
||||
mkerrors="$mkerrors -m32"
|
||||
mksyscall="./mksyscall.pl -l32 -darwin"
|
||||
mksysnum="./mksysnum_darwin.pl /usr/include/sys/syscall.h"
|
||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
||||
mkasm="go run mkasm_darwin.go"
|
||||
;;
|
||||
dragonfly_amd64)
|
||||
mkerrors="$mkerrors -m64"
|
||||
@ -337,4 +350,5 @@ esac
|
||||
# Therefore, "go run" tries to recompile syscall package but ztypes is empty and it fails.
|
||||
echo "$mktypes types_$GOOS.go |go run mkpost.go >ztypes_$GOOSARCH.go.NEW && mv ztypes_$GOOSARCH.go.NEW ztypes_$GOOSARCH.go";
|
||||
fi
|
||||
if [ -n "$mkasm" ]; then echo "$mkasm $GOARCH"; fi
|
||||
) | $run
|
||||
|
53
src/syscall/mkasm_darwin.go
Normal file
53
src/syscall/mkasm_darwin.go
Normal file
@ -0,0 +1,53 @@
|
||||
// Copyright 2018 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 ignore
|
||||
|
||||
// mkasm_darwin.go generates assembly trampolines to call libSystem routines from Go.
|
||||
//This program must be run after mksyscall.pl.
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
in1, err := ioutil.ReadFile("syscall_darwin.go")
|
||||
if err != nil {
|
||||
log.Fatalf("can't open syscall_darwin.go: %s", err)
|
||||
}
|
||||
arch := os.Args[1]
|
||||
in2, err := ioutil.ReadFile(fmt.Sprintf("syscall_darwin_%s.go", arch))
|
||||
if err != nil {
|
||||
log.Fatalf("can't open syscall_darwin_%s.go: %s", arch, err)
|
||||
}
|
||||
in3, err := ioutil.ReadFile(fmt.Sprintf("zsyscall_darwin_%s.go", arch))
|
||||
if err != nil {
|
||||
log.Fatalf("can't open zsyscall_darwin_%s.go: %s", arch, err)
|
||||
}
|
||||
in := string(in1) + string(in2) + string(in3)
|
||||
|
||||
var out bytes.Buffer
|
||||
|
||||
fmt.Fprintf(&out, "// go run mkasm_darwin.go %s\n", strings.Join(os.Args[1:], " "))
|
||||
fmt.Fprintf(&out, "// Code generated by the command above; DO NOT EDIT.\n")
|
||||
fmt.Fprintf(&out, "#include \"textflag.h\"\n")
|
||||
for _, line := range strings.Split(in, "\n") {
|
||||
if !strings.HasPrefix(line, "func ") || !strings.HasSuffix(line, "_trampoline()") {
|
||||
continue
|
||||
}
|
||||
fn := line[5 : len(line)-13]
|
||||
fmt.Fprintf(&out, "TEXT ·%s_trampoline(SB),NOSPLIT,$0-0\n", fn)
|
||||
fmt.Fprintf(&out, "\tJMP\t%s(SB)\n", fn)
|
||||
}
|
||||
err = ioutil.WriteFile(fmt.Sprintf("zsyscall_darwin_%s.s", arch), out.Bytes(), 0644)
|
||||
if err != nil {
|
||||
log.Fatalf("can't write zsyscall_darwin_%s.s: %s", arch, err)
|
||||
}
|
||||
}
|
@ -25,6 +25,7 @@ my $cmdline = "mksyscall.pl " . join(' ', @ARGV);
|
||||
my $errors = 0;
|
||||
my $_32bit = "";
|
||||
my $plan9 = 0;
|
||||
my $darwin = 0;
|
||||
my $openbsd = 0;
|
||||
my $netbsd = 0;
|
||||
my $dragonfly = 0;
|
||||
@ -43,6 +44,10 @@ if($ARGV[0] eq "-plan9") {
|
||||
$plan9 = 1;
|
||||
shift;
|
||||
}
|
||||
if($ARGV[0] eq "-darwin") {
|
||||
$darwin = 1;
|
||||
shift;
|
||||
}
|
||||
if($ARGV[0] eq "-openbsd") {
|
||||
$openbsd = 1;
|
||||
shift;
|
||||
@ -211,6 +216,11 @@ while(<>) {
|
||||
$asm = "RawSyscall";
|
||||
}
|
||||
}
|
||||
if ($darwin) {
|
||||
# Call unexported syscall functions (which take
|
||||
# libc functions instead of syscall numbers).
|
||||
$asm = lcfirst($asm);
|
||||
}
|
||||
if(@args <= 3) {
|
||||
while(@args < 3) {
|
||||
push @args, "0";
|
||||
@ -229,7 +239,16 @@ while(<>) {
|
||||
print STDERR "$ARGV:$.: too many arguments to system call\n";
|
||||
}
|
||||
|
||||
if ($darwin) {
|
||||
# Use extended versions for calls that generate a 64-bit result.
|
||||
my ($name, $type) = parseparam($out[0]);
|
||||
if ($type eq "int64" || ($type eq "uintptr" && $_32bit eq "")) {
|
||||
$asm .= "X";
|
||||
}
|
||||
}
|
||||
|
||||
# System call number.
|
||||
my $funcname = "";
|
||||
if($sysname eq "") {
|
||||
$sysname = "SYS_$func";
|
||||
$sysname =~ s/([a-z])([A-Z])/${1}_$2/g; # turn FooBar into Foo_Bar
|
||||
@ -237,6 +256,18 @@ while(<>) {
|
||||
if($nacl) {
|
||||
$sysname =~ y/A-Z/a-z/;
|
||||
}
|
||||
if($darwin) {
|
||||
$sysname =~ y/A-Z/a-z/;
|
||||
$sysname = substr $sysname, 4;
|
||||
$funcname = "libc_$sysname";
|
||||
}
|
||||
}
|
||||
if($darwin) {
|
||||
if($funcname eq "") {
|
||||
$sysname = substr $sysname, 4;
|
||||
$funcname = "libc_$sysname";
|
||||
}
|
||||
$sysname = "funcPC(${funcname}_trampoline)";
|
||||
}
|
||||
|
||||
# Actual call.
|
||||
@ -306,6 +337,16 @@ while(<>) {
|
||||
}
|
||||
$text .= "\treturn\n";
|
||||
$text .= "}\n\n";
|
||||
if($darwin) {
|
||||
# The assembly trampoline that jumps to the libc routine.
|
||||
$text .= "func ${funcname}_trampoline()\n";
|
||||
# Map syscall.funcname to just plain funcname.
|
||||
# (The jump to this function is in the assembly trampoline, generated by mksyscallasm_darwin.go.)
|
||||
$text .= "//go:linkname $funcname $funcname\n";
|
||||
# Tell the linker that funcname can be found in libSystem using varname without the libc_ prefix.
|
||||
my $basename = substr $funcname, 5;
|
||||
$text .= "//go:cgo_import_dynamic $funcname $basename \"/usr/lib/libSystem.B.dylib\"\n";
|
||||
}
|
||||
}
|
||||
|
||||
chomp $text;
|
||||
|
@ -447,8 +447,6 @@ func Kevent(kq int, changes, events []Kevent_t, timeout *Timespec) (n int, err e
|
||||
return kevent(kq, change, len(changes), event, len(events), timeout)
|
||||
}
|
||||
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
|
||||
|
||||
func Sysctl(name string) (value string, err error) {
|
||||
// Translate name to mib number.
|
||||
mib, err := nametomib(name)
|
||||
|
@ -120,8 +120,8 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (
|
||||
return nil, err
|
||||
}
|
||||
|
||||
_, _, e1 := Syscall6(
|
||||
SYS_GETATTRLIST,
|
||||
_, _, e1 := syscall6(
|
||||
funcPC(libc_getattrlist_trampoline),
|
||||
uintptr(unsafe.Pointer(_p0)),
|
||||
uintptr(unsafe.Pointer(&attrList)),
|
||||
uintptr(unsafe.Pointer(&attrBuf[0])),
|
||||
@ -163,13 +163,21 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (
|
||||
return
|
||||
}
|
||||
|
||||
//sysnb pipe() (r int, w int, err error)
|
||||
func libc_getattrlist_trampoline()
|
||||
|
||||
//go:linkname libc_getattrlist libc_getattrlist
|
||||
//go:cgo_import_dynamic libc_getattrlist getattrlist "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
//sysnb pipe(p *[2]int32) (err error)
|
||||
|
||||
func Pipe(p []int) (err error) {
|
||||
if len(p) != 2 {
|
||||
return EINVAL
|
||||
}
|
||||
p[0], p[1], err = pipe()
|
||||
var q [2]int32
|
||||
err = pipe(&q)
|
||||
p[0] = int(q[0])
|
||||
p[1] = int(q[1])
|
||||
return
|
||||
}
|
||||
|
||||
@ -180,7 +188,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||
_p0 = unsafe.Pointer(&buf[0])
|
||||
bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
|
||||
}
|
||||
r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(_p0), bufsize, uintptr(flags))
|
||||
r0, _, e1 := syscall(funcPC(libc_getfsstat64_trampoline), uintptr(_p0), bufsize, uintptr(flags))
|
||||
n = int(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
@ -188,6 +196,11 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func libc_getfsstat64_trampoline()
|
||||
|
||||
//go:linkname libc_getfsstat64 libc_getfsstat64
|
||||
//go:cgo_import_dynamic libc_getfsstat64 getfsstat64 "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
func setattrlistTimes(path string, times []Timespec) error {
|
||||
_p0, err := BytePtrFromString(path)
|
||||
if err != nil {
|
||||
@ -201,8 +214,8 @@ func setattrlistTimes(path string, times []Timespec) error {
|
||||
// order is mtime, atime: the opposite of Chtimes
|
||||
attributes := [2]Timespec{times[1], times[0]}
|
||||
const options = 0
|
||||
_, _, e1 := Syscall6(
|
||||
SYS_SETATTRLIST,
|
||||
_, _, e1 := syscall6(
|
||||
funcPC(libc_setattrlist_trampoline),
|
||||
uintptr(unsafe.Pointer(_p0)),
|
||||
uintptr(unsafe.Pointer(&attrList)),
|
||||
uintptr(unsafe.Pointer(&attributes)),
|
||||
@ -216,6 +229,11 @@ func setattrlistTimes(path string, times []Timespec) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func libc_setattrlist_trampoline()
|
||||
|
||||
//go:linkname libc_setattrlist libc_setattrlist
|
||||
//go:cgo_import_dynamic libc_setattrlist setattrlist "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
func utimensat(dirfd int, path string, times *[2]Timespec, flag int) error {
|
||||
// Darwin doesn't support SYS_UTIMENSAT
|
||||
return ENOSYS
|
||||
@ -249,12 +267,12 @@ func Kill(pid int, signum Signal) (err error) { return kill(pid, int(signum), 1)
|
||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||
//sys Flock(fd int, how int) (err error)
|
||||
//sys Fpathconf(fd int, name int) (val int, err error)
|
||||
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
||||
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
|
||||
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_fstat64
|
||||
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_fstatfs64
|
||||
//sys Fsync(fd int) (err error)
|
||||
// Fsync is not called for os.File.Sync(). Please see internal/poll/fd_fsync_darwin.go
|
||||
//sys Ftruncate(fd int, length int64) (err error)
|
||||
//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
|
||||
//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS___getdirentries64
|
||||
//sys Getdtablesize() (size int)
|
||||
//sysnb Getegid() (egid int)
|
||||
//sysnb Geteuid() (uid int)
|
||||
@ -273,7 +291,7 @@ func Kill(pid int, signum Signal) (err error) { return kill(pid, int(signum), 1)
|
||||
//sys Lchown(path string, uid int, gid int) (err error)
|
||||
//sys Link(path string, link string) (err error)
|
||||
//sys Listen(s int, backlog int) (err error)
|
||||
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
||||
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_lstat64
|
||||
//sys Mkdir(path string, mode uint32) (err error)
|
||||
//sys Mkfifo(path string, mode uint32) (err error)
|
||||
//sys Mknod(path string, mode uint32, dev int) (err error)
|
||||
@ -291,7 +309,7 @@ func Kill(pid int, signum Signal) (err error) { return kill(pid, int(signum), 1)
|
||||
//sys Rename(from string, to string) (err error)
|
||||
//sys Revoke(path string) (err error)
|
||||
//sys Rmdir(path string) (err error)
|
||||
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
|
||||
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_lseek
|
||||
//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
|
||||
//sys Setegid(egid int) (err error)
|
||||
//sysnb Seteuid(euid int) (err error)
|
||||
@ -306,8 +324,8 @@ func Kill(pid int, signum Signal) (err error) { return kill(pid, int(signum), 1)
|
||||
//sysnb Setsid() (pid int, err error)
|
||||
//sysnb Settimeofday(tp *Timeval) (err error)
|
||||
//sysnb Setuid(uid int) (err error)
|
||||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
||||
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
|
||||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_stat64
|
||||
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_statfs64
|
||||
//sys Symlink(path string, link string) (err error)
|
||||
//sys Sync() (err error)
|
||||
//sys Truncate(path string, length int64) (err error)
|
||||
@ -316,7 +334,43 @@ func Kill(pid int, signum Signal) (err error) { return kill(pid, int(signum), 1)
|
||||
//sys Unlink(path string) (err error)
|
||||
//sys Unmount(path string, flags int) (err error)
|
||||
//sys write(fd int, p []byte) (n int, err error)
|
||||
//sys writev(fd int, iovecs []Iovec) (cnt uintptr, err error)
|
||||
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
||||
//sysnb fork() (pid int, err error)
|
||||
//sysnb ioctl(fd int, req int, arg int) (err error)
|
||||
//sysnb execve(path *byte, argv *byte, envp *byte) (err error)
|
||||
//sysnb exit(res int) (err error)
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error)
|
||||
|
||||
func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
|
||||
r0, _, e1 := syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
|
||||
n = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
|
||||
r0, _, e1 := syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
|
||||
n = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Implemented in the runtime package (runtime/sys_darwin.go)
|
||||
func syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
|
||||
func syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
|
||||
func syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
|
||||
func rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
|
||||
func rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
|
||||
|
||||
// Find the entry point for f. See comments in runtime/proc.go for the
|
||||
// function of the same name.
|
||||
//go:nosplit
|
||||
func funcPC(f func()) uintptr {
|
||||
return **(**uintptr)(unsafe.Pointer(&f))
|
||||
}
|
||||
|
@ -14,23 +14,7 @@ func setTimeval(sec, usec int64) Timeval {
|
||||
return Timeval{Sec: int32(sec), Usec: int32(usec)}
|
||||
}
|
||||
|
||||
//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
|
||||
func Gettimeofday(tv *Timeval) error {
|
||||
// The tv passed to gettimeofday must be non-nil.
|
||||
// Before macOS Sierra (10.12), tv was otherwise unused and
|
||||
// the answers came back in the two registers.
|
||||
// As of Sierra, gettimeofday return zeros and populates
|
||||
// tv itself.
|
||||
sec, usec, err := gettimeofday(tv)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if sec != 0 || usec != 0 {
|
||||
tv.Sec = int32(sec)
|
||||
tv.Usec = int32(usec)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
//sysnb Gettimeofday(tp *Timeval) (err error)
|
||||
|
||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||
k.Ident = uint32(fd)
|
||||
@ -53,7 +37,7 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
||||
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
||||
var length = uint64(count)
|
||||
|
||||
_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0)
|
||||
_, _, e1 := Syscall9(funcPC(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0)
|
||||
|
||||
written = int(length)
|
||||
|
||||
@ -63,4 +47,12 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||
return
|
||||
}
|
||||
|
||||
func libc_sendfile_trampoline()
|
||||
|
||||
//go:linkname libc_sendfile libc_sendfile
|
||||
//go:cgo_import_dynamic libc_sendfile sendfile "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// Implemented in the runtime package (runtime/sys_darwin_32.go)
|
||||
func syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno)
|
||||
|
||||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // sic
|
||||
|
@ -14,23 +14,7 @@ func setTimeval(sec, usec int64) Timeval {
|
||||
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||
}
|
||||
|
||||
//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
|
||||
func Gettimeofday(tv *Timeval) error {
|
||||
// The tv passed to gettimeofday must be non-nil.
|
||||
// Before macOS Sierra (10.12), tv was otherwise unused and
|
||||
// the answers came back in the two registers.
|
||||
// As of Sierra, gettimeofday return zeros and populates
|
||||
// tv itself.
|
||||
sec, usec, err := gettimeofday(tv)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if sec != 0 || usec != 0 {
|
||||
tv.Sec = sec
|
||||
tv.Usec = usec
|
||||
}
|
||||
return nil
|
||||
}
|
||||
//sysnb Gettimeofday(tp *Timeval) (err error)
|
||||
|
||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||
k.Ident = uint64(fd)
|
||||
@ -53,7 +37,7 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
||||
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
||||
var length = uint64(count)
|
||||
|
||||
_, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0)
|
||||
_, _, e1 := syscall6(funcPC(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0)
|
||||
|
||||
written = int(length)
|
||||
|
||||
@ -63,4 +47,12 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||
return
|
||||
}
|
||||
|
||||
func libc_sendfile_trampoline()
|
||||
|
||||
//go:linkname libc_sendfile libc_sendfile
|
||||
//go:cgo_import_dynamic libc_sendfile sendfile "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// Implemented in the runtime package (runtime/sys_darwin_64.go)
|
||||
func syscallX(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
|
||||
|
||||
func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno)
|
||||
|
@ -14,21 +14,7 @@ func setTimeval(sec, usec int64) Timeval {
|
||||
return Timeval{Sec: int32(sec), Usec: int32(usec)}
|
||||
}
|
||||
|
||||
//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
|
||||
func Gettimeofday(tv *Timeval) error {
|
||||
// The tv passed to gettimeofday must be non-nil
|
||||
// but is otherwise unused. The answers come back
|
||||
// in the two registers.
|
||||
sec, usec, err := gettimeofday(tv)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if sec != 0 || usec != 0 {
|
||||
tv.Sec = int32(sec)
|
||||
tv.Usec = int32(usec)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
//sysnb Gettimeofday(tp *Timeval) (err error)
|
||||
|
||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||
k.Ident = uint32(fd)
|
||||
@ -51,7 +37,7 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
||||
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
||||
var length = uint64(count)
|
||||
|
||||
_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0)
|
||||
_, _, e1 := Syscall9(funcPC(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0)
|
||||
|
||||
written = int(length)
|
||||
|
||||
@ -61,4 +47,12 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||
return
|
||||
}
|
||||
|
||||
func libc_sendfile_trampoline()
|
||||
|
||||
//go:linkname libc_sendfile libc_sendfile
|
||||
//go:cgo_import_dynamic libc_sendfile sendfile "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// Implemented in the runtime package (runtime/sys_darwin_32.go)
|
||||
func syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno)
|
||||
|
||||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // sic
|
||||
|
@ -14,21 +14,7 @@ func setTimeval(sec, usec int64) Timeval {
|
||||
return Timeval{Sec: int64(sec), Usec: int32(usec)}
|
||||
}
|
||||
|
||||
//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
|
||||
func Gettimeofday(tv *Timeval) error {
|
||||
// The tv passed to gettimeofday must be non-nil
|
||||
// but is otherwise unused. The answers come back
|
||||
// in the two registers.
|
||||
sec, usec, err := gettimeofday(tv)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if sec != 0 || usec != 0 {
|
||||
tv.Sec = sec
|
||||
tv.Usec = usec
|
||||
}
|
||||
return nil
|
||||
}
|
||||
//sysnb Gettimeofday(tp *Timeval) (err error)
|
||||
|
||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||
k.Ident = uint64(fd)
|
||||
@ -51,7 +37,7 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
||||
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
||||
var length = uint64(count)
|
||||
|
||||
_, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0)
|
||||
_, _, e1 := syscall6(funcPC(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0)
|
||||
|
||||
written = int(length)
|
||||
|
||||
@ -61,4 +47,12 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||
return
|
||||
}
|
||||
|
||||
func libc_sendfile_trampoline()
|
||||
|
||||
//go:linkname libc_sendfile libc_sendfile
|
||||
//go:cgo_import_dynamic libc_sendfile sendfile "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// Implemented in the runtime package (runtime/sys_darwin_64.go)
|
||||
func syscallX(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
|
||||
|
||||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // sic
|
||||
|
@ -217,3 +217,4 @@ func setattrlistTimes(path string, times []Timespec) error {
|
||||
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
|
||||
//sys utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error)
|
||||
//sys getcwd(buf []byte) (n int, err error) = SYS___GETCWD
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
|
||||
|
@ -492,3 +492,4 @@ func convertFromDirents11(buf []byte, old []byte) int {
|
||||
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
|
||||
//sys utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error)
|
||||
//sys getcwd(buf []byte) (n int, err error) = SYS___GETCWD
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
|
||||
|
@ -52,7 +52,6 @@ func sysctlNodes(mib []_C_int) (nodes []Sysctlnode, err error) {
|
||||
}
|
||||
|
||||
func nametomib(name string) (mib []_C_int, err error) {
|
||||
|
||||
// Split name into components.
|
||||
var parts []string
|
||||
last := 0
|
||||
@ -234,3 +233,4 @@ func setattrlistTimes(path string, times []Timespec) error {
|
||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
||||
//sys utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error)
|
||||
//sys getcwd(buf []byte) (n int, err error) = SYS___GETCWD
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
|
||||
|
@ -29,7 +29,6 @@ type SockaddrDatalink struct {
|
||||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno)
|
||||
|
||||
func nametomib(name string) (mib []_C_int, err error) {
|
||||
|
||||
// Perform lookup via a binary search
|
||||
left := 0
|
||||
right := len(sysctlMib) - 1
|
||||
@ -212,3 +211,4 @@ func setattrlistTimes(path string, times []Timespec) error {
|
||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
||||
//sys utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error)
|
||||
//sys getcwd(buf []byte) (n int, err error) = SYS___GETCWD
|
||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
|
||||
|
@ -315,6 +315,12 @@ func TestRlimit(t *testing.T) {
|
||||
}
|
||||
set := rlimit
|
||||
set.Cur = set.Max - 1
|
||||
if runtime.GOOS == "darwin" && set.Cur > 10240 {
|
||||
// The max file limit is 10240, even though
|
||||
// the max returned by Getrlimit is 1<<63-1.
|
||||
// This is OPEN_MAX in sys/syslimits.h.
|
||||
set.Cur = 10240
|
||||
}
|
||||
err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &set)
|
||||
if err != nil {
|
||||
t.Fatalf("Setrlimit: set failed: %#v %v", set, err)
|
||||
@ -326,15 +332,11 @@ func TestRlimit(t *testing.T) {
|
||||
}
|
||||
set = rlimit
|
||||
set.Cur = set.Max - 1
|
||||
if runtime.GOOS == "darwin" && set.Cur > 10240 {
|
||||
set.Cur = 10240
|
||||
}
|
||||
if set != get {
|
||||
// Seems like Darwin requires some privilege to
|
||||
// increase the soft limit of rlimit sandbox, though
|
||||
// Setrlimit never reports an error.
|
||||
switch runtime.GOOS {
|
||||
case "darwin":
|
||||
default:
|
||||
t.Fatalf("Rlimit: change failed: wanted %#v got %#v", set, get)
|
||||
}
|
||||
t.Fatalf("Rlimit: change failed: wanted %#v got %#v", set, get)
|
||||
}
|
||||
err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlimit)
|
||||
if err != nil {
|
||||
|
File diff suppressed because it is too large
Load Diff
243
src/syscall/zsyscall_darwin_386.s
Normal file
243
src/syscall/zsyscall_darwin_386.s
Normal file
@ -0,0 +1,243 @@
|
||||
// go run mkasm_darwin.go 386
|
||||
// Code generated by the command above; DO NOT EDIT.
|
||||
#include "textflag.h"
|
||||
TEXT ·libc_getattrlist_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getattrlist(SB)
|
||||
TEXT ·libc_getfsstat64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getfsstat64(SB)
|
||||
TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setattrlist(SB)
|
||||
TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sendfile(SB)
|
||||
TEXT ·libc_getgroups_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getgroups(SB)
|
||||
TEXT ·libc_setgroups_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setgroups(SB)
|
||||
TEXT ·libc_wait4_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_wait4(SB)
|
||||
TEXT ·libc_accept_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_accept(SB)
|
||||
TEXT ·libc_bind_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_bind(SB)
|
||||
TEXT ·libc_connect_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_connect(SB)
|
||||
TEXT ·libc_socket_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_socket(SB)
|
||||
TEXT ·libc_getsockopt_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getsockopt(SB)
|
||||
TEXT ·libc_setsockopt_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setsockopt(SB)
|
||||
TEXT ·libc_getpeername_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpeername(SB)
|
||||
TEXT ·libc_getsockname_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getsockname(SB)
|
||||
TEXT ·libc_shutdown_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_shutdown(SB)
|
||||
TEXT ·libc_socketpair_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_socketpair(SB)
|
||||
TEXT ·libc_recvfrom_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_recvfrom(SB)
|
||||
TEXT ·libc_sendto_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sendto(SB)
|
||||
TEXT ·libc_recvmsg_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_recvmsg(SB)
|
||||
TEXT ·libc_sendmsg_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sendmsg(SB)
|
||||
TEXT ·libc_kevent_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_kevent(SB)
|
||||
TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_utimes(SB)
|
||||
TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_futimes(SB)
|
||||
TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fcntl(SB)
|
||||
TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ptrace(SB)
|
||||
TEXT ·libc_pipe_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_pipe(SB)
|
||||
TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_kill(SB)
|
||||
TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_access(SB)
|
||||
TEXT ·libc_adjtime_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_adjtime(SB)
|
||||
TEXT ·libc_chdir_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chdir(SB)
|
||||
TEXT ·libc_chflags_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chflags(SB)
|
||||
TEXT ·libc_chmod_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chmod(SB)
|
||||
TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chown(SB)
|
||||
TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chroot(SB)
|
||||
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_close(SB)
|
||||
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_dup(SB)
|
||||
TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_dup2(SB)
|
||||
TEXT ·libc_exchangedata_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_exchangedata(SB)
|
||||
TEXT ·libc_fchdir_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fchdir(SB)
|
||||
TEXT ·libc_fchflags_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fchflags(SB)
|
||||
TEXT ·libc_fchmod_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fchmod(SB)
|
||||
TEXT ·libc_fchown_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fchown(SB)
|
||||
TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_flock(SB)
|
||||
TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fpathconf(SB)
|
||||
TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fstat64(SB)
|
||||
TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fstatfs64(SB)
|
||||
TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fsync(SB)
|
||||
TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ftruncate(SB)
|
||||
TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc___getdirentries64(SB)
|
||||
TEXT ·libc_getdtablesize_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getdtablesize(SB)
|
||||
TEXT ·libc_getegid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getegid(SB)
|
||||
TEXT ·libc_geteuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_geteuid(SB)
|
||||
TEXT ·libc_getgid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getgid(SB)
|
||||
TEXT ·libc_getpgid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpgid(SB)
|
||||
TEXT ·libc_getpgrp_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpgrp(SB)
|
||||
TEXT ·libc_getpid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpid(SB)
|
||||
TEXT ·libc_getppid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getppid(SB)
|
||||
TEXT ·libc_getpriority_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpriority(SB)
|
||||
TEXT ·libc_getrlimit_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getrlimit(SB)
|
||||
TEXT ·libc_getrusage_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getrusage(SB)
|
||||
TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getsid(SB)
|
||||
TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getuid(SB)
|
||||
TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_issetugid(SB)
|
||||
TEXT ·libc_kqueue_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_kqueue(SB)
|
||||
TEXT ·libc_lchown_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_lchown(SB)
|
||||
TEXT ·libc_link_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_link(SB)
|
||||
TEXT ·libc_listen_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_listen(SB)
|
||||
TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_lstat64(SB)
|
||||
TEXT ·libc_mkdir_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mkdir(SB)
|
||||
TEXT ·libc_mkfifo_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mkfifo(SB)
|
||||
TEXT ·libc_mknod_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mknod(SB)
|
||||
TEXT ·libc_mlock_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mlock(SB)
|
||||
TEXT ·libc_mlockall_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mlockall(SB)
|
||||
TEXT ·libc_mprotect_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mprotect(SB)
|
||||
TEXT ·libc_munlock_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_munlock(SB)
|
||||
TEXT ·libc_munlockall_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_munlockall(SB)
|
||||
TEXT ·libc_open_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_open(SB)
|
||||
TEXT ·libc_pathconf_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_pathconf(SB)
|
||||
TEXT ·libc_pread_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_pread(SB)
|
||||
TEXT ·libc_pwrite_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_pwrite(SB)
|
||||
TEXT ·libc_read_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_read(SB)
|
||||
TEXT ·libc_readlink_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_readlink(SB)
|
||||
TEXT ·libc_rename_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_rename(SB)
|
||||
TEXT ·libc_revoke_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_revoke(SB)
|
||||
TEXT ·libc_rmdir_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_rmdir(SB)
|
||||
TEXT ·libc_lseek_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_lseek(SB)
|
||||
TEXT ·libc_select_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_select(SB)
|
||||
TEXT ·libc_setegid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setegid(SB)
|
||||
TEXT ·libc_seteuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_seteuid(SB)
|
||||
TEXT ·libc_setgid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setgid(SB)
|
||||
TEXT ·libc_setlogin_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setlogin(SB)
|
||||
TEXT ·libc_setpgid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setpgid(SB)
|
||||
TEXT ·libc_setpriority_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setpriority(SB)
|
||||
TEXT ·libc_setprivexec_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setprivexec(SB)
|
||||
TEXT ·libc_setregid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setregid(SB)
|
||||
TEXT ·libc_setreuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setreuid(SB)
|
||||
TEXT ·libc_setrlimit_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setrlimit(SB)
|
||||
TEXT ·libc_setsid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setsid(SB)
|
||||
TEXT ·libc_settimeofday_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_settimeofday(SB)
|
||||
TEXT ·libc_setuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setuid(SB)
|
||||
TEXT ·libc_stat64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_stat64(SB)
|
||||
TEXT ·libc_statfs64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_statfs64(SB)
|
||||
TEXT ·libc_symlink_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_symlink(SB)
|
||||
TEXT ·libc_sync_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sync(SB)
|
||||
TEXT ·libc_truncate_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_truncate(SB)
|
||||
TEXT ·libc_umask_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_umask(SB)
|
||||
TEXT ·libc_undelete_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_undelete(SB)
|
||||
TEXT ·libc_unlink_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_unlink(SB)
|
||||
TEXT ·libc_unmount_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_unmount(SB)
|
||||
TEXT ·libc_write_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_write(SB)
|
||||
TEXT ·libc_mmap_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mmap(SB)
|
||||
TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_munmap(SB)
|
||||
TEXT ·libc_fork_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fork(SB)
|
||||
TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ioctl(SB)
|
||||
TEXT ·libc_execve_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_execve(SB)
|
||||
TEXT ·libc_exit_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_exit(SB)
|
||||
TEXT ·libc_sysctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sysctl(SB)
|
||||
TEXT ·libc_writev_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_writev(SB)
|
||||
TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_gettimeofday(SB)
|
File diff suppressed because it is too large
Load Diff
243
src/syscall/zsyscall_darwin_amd64.s
Normal file
243
src/syscall/zsyscall_darwin_amd64.s
Normal file
@ -0,0 +1,243 @@
|
||||
// go run mkasm_darwin.go amd64
|
||||
// Code generated by the command above; DO NOT EDIT.
|
||||
#include "textflag.h"
|
||||
TEXT ·libc_getattrlist_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getattrlist(SB)
|
||||
TEXT ·libc_getfsstat64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getfsstat64(SB)
|
||||
TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setattrlist(SB)
|
||||
TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sendfile(SB)
|
||||
TEXT ·libc_getgroups_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getgroups(SB)
|
||||
TEXT ·libc_setgroups_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setgroups(SB)
|
||||
TEXT ·libc_wait4_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_wait4(SB)
|
||||
TEXT ·libc_accept_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_accept(SB)
|
||||
TEXT ·libc_bind_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_bind(SB)
|
||||
TEXT ·libc_connect_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_connect(SB)
|
||||
TEXT ·libc_socket_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_socket(SB)
|
||||
TEXT ·libc_getsockopt_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getsockopt(SB)
|
||||
TEXT ·libc_setsockopt_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setsockopt(SB)
|
||||
TEXT ·libc_getpeername_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpeername(SB)
|
||||
TEXT ·libc_getsockname_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getsockname(SB)
|
||||
TEXT ·libc_shutdown_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_shutdown(SB)
|
||||
TEXT ·libc_socketpair_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_socketpair(SB)
|
||||
TEXT ·libc_recvfrom_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_recvfrom(SB)
|
||||
TEXT ·libc_sendto_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sendto(SB)
|
||||
TEXT ·libc_recvmsg_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_recvmsg(SB)
|
||||
TEXT ·libc_sendmsg_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sendmsg(SB)
|
||||
TEXT ·libc_kevent_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_kevent(SB)
|
||||
TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_utimes(SB)
|
||||
TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_futimes(SB)
|
||||
TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fcntl(SB)
|
||||
TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ptrace(SB)
|
||||
TEXT ·libc_pipe_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_pipe(SB)
|
||||
TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_kill(SB)
|
||||
TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_access(SB)
|
||||
TEXT ·libc_adjtime_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_adjtime(SB)
|
||||
TEXT ·libc_chdir_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chdir(SB)
|
||||
TEXT ·libc_chflags_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chflags(SB)
|
||||
TEXT ·libc_chmod_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chmod(SB)
|
||||
TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chown(SB)
|
||||
TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chroot(SB)
|
||||
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_close(SB)
|
||||
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_dup(SB)
|
||||
TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_dup2(SB)
|
||||
TEXT ·libc_exchangedata_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_exchangedata(SB)
|
||||
TEXT ·libc_fchdir_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fchdir(SB)
|
||||
TEXT ·libc_fchflags_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fchflags(SB)
|
||||
TEXT ·libc_fchmod_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fchmod(SB)
|
||||
TEXT ·libc_fchown_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fchown(SB)
|
||||
TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_flock(SB)
|
||||
TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fpathconf(SB)
|
||||
TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fstat64(SB)
|
||||
TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fstatfs64(SB)
|
||||
TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fsync(SB)
|
||||
TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ftruncate(SB)
|
||||
TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc___getdirentries64(SB)
|
||||
TEXT ·libc_getdtablesize_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getdtablesize(SB)
|
||||
TEXT ·libc_getegid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getegid(SB)
|
||||
TEXT ·libc_geteuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_geteuid(SB)
|
||||
TEXT ·libc_getgid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getgid(SB)
|
||||
TEXT ·libc_getpgid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpgid(SB)
|
||||
TEXT ·libc_getpgrp_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpgrp(SB)
|
||||
TEXT ·libc_getpid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpid(SB)
|
||||
TEXT ·libc_getppid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getppid(SB)
|
||||
TEXT ·libc_getpriority_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpriority(SB)
|
||||
TEXT ·libc_getrlimit_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getrlimit(SB)
|
||||
TEXT ·libc_getrusage_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getrusage(SB)
|
||||
TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getsid(SB)
|
||||
TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getuid(SB)
|
||||
TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_issetugid(SB)
|
||||
TEXT ·libc_kqueue_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_kqueue(SB)
|
||||
TEXT ·libc_lchown_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_lchown(SB)
|
||||
TEXT ·libc_link_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_link(SB)
|
||||
TEXT ·libc_listen_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_listen(SB)
|
||||
TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_lstat64(SB)
|
||||
TEXT ·libc_mkdir_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mkdir(SB)
|
||||
TEXT ·libc_mkfifo_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mkfifo(SB)
|
||||
TEXT ·libc_mknod_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mknod(SB)
|
||||
TEXT ·libc_mlock_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mlock(SB)
|
||||
TEXT ·libc_mlockall_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mlockall(SB)
|
||||
TEXT ·libc_mprotect_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mprotect(SB)
|
||||
TEXT ·libc_munlock_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_munlock(SB)
|
||||
TEXT ·libc_munlockall_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_munlockall(SB)
|
||||
TEXT ·libc_open_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_open(SB)
|
||||
TEXT ·libc_pathconf_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_pathconf(SB)
|
||||
TEXT ·libc_pread_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_pread(SB)
|
||||
TEXT ·libc_pwrite_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_pwrite(SB)
|
||||
TEXT ·libc_read_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_read(SB)
|
||||
TEXT ·libc_readlink_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_readlink(SB)
|
||||
TEXT ·libc_rename_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_rename(SB)
|
||||
TEXT ·libc_revoke_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_revoke(SB)
|
||||
TEXT ·libc_rmdir_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_rmdir(SB)
|
||||
TEXT ·libc_lseek_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_lseek(SB)
|
||||
TEXT ·libc_select_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_select(SB)
|
||||
TEXT ·libc_setegid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setegid(SB)
|
||||
TEXT ·libc_seteuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_seteuid(SB)
|
||||
TEXT ·libc_setgid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setgid(SB)
|
||||
TEXT ·libc_setlogin_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setlogin(SB)
|
||||
TEXT ·libc_setpgid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setpgid(SB)
|
||||
TEXT ·libc_setpriority_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setpriority(SB)
|
||||
TEXT ·libc_setprivexec_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setprivexec(SB)
|
||||
TEXT ·libc_setregid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setregid(SB)
|
||||
TEXT ·libc_setreuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setreuid(SB)
|
||||
TEXT ·libc_setrlimit_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setrlimit(SB)
|
||||
TEXT ·libc_setsid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setsid(SB)
|
||||
TEXT ·libc_settimeofday_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_settimeofday(SB)
|
||||
TEXT ·libc_setuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setuid(SB)
|
||||
TEXT ·libc_stat64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_stat64(SB)
|
||||
TEXT ·libc_statfs64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_statfs64(SB)
|
||||
TEXT ·libc_symlink_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_symlink(SB)
|
||||
TEXT ·libc_sync_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sync(SB)
|
||||
TEXT ·libc_truncate_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_truncate(SB)
|
||||
TEXT ·libc_umask_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_umask(SB)
|
||||
TEXT ·libc_undelete_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_undelete(SB)
|
||||
TEXT ·libc_unlink_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_unlink(SB)
|
||||
TEXT ·libc_unmount_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_unmount(SB)
|
||||
TEXT ·libc_write_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_write(SB)
|
||||
TEXT ·libc_mmap_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mmap(SB)
|
||||
TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_munmap(SB)
|
||||
TEXT ·libc_fork_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fork(SB)
|
||||
TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ioctl(SB)
|
||||
TEXT ·libc_execve_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_execve(SB)
|
||||
TEXT ·libc_exit_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_exit(SB)
|
||||
TEXT ·libc_sysctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sysctl(SB)
|
||||
TEXT ·libc_writev_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_writev(SB)
|
||||
TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_gettimeofday(SB)
|
File diff suppressed because it is too large
Load Diff
243
src/syscall/zsyscall_darwin_arm.s
Normal file
243
src/syscall/zsyscall_darwin_arm.s
Normal file
@ -0,0 +1,243 @@
|
||||
// go run mkasm_darwin.go arm
|
||||
// Code generated by the command above; DO NOT EDIT.
|
||||
#include "textflag.h"
|
||||
TEXT ·libc_getattrlist_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getattrlist(SB)
|
||||
TEXT ·libc_getfsstat64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getfsstat64(SB)
|
||||
TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setattrlist(SB)
|
||||
TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sendfile(SB)
|
||||
TEXT ·libc_getgroups_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getgroups(SB)
|
||||
TEXT ·libc_setgroups_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setgroups(SB)
|
||||
TEXT ·libc_wait4_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_wait4(SB)
|
||||
TEXT ·libc_accept_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_accept(SB)
|
||||
TEXT ·libc_bind_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_bind(SB)
|
||||
TEXT ·libc_connect_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_connect(SB)
|
||||
TEXT ·libc_socket_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_socket(SB)
|
||||
TEXT ·libc_getsockopt_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getsockopt(SB)
|
||||
TEXT ·libc_setsockopt_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setsockopt(SB)
|
||||
TEXT ·libc_getpeername_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpeername(SB)
|
||||
TEXT ·libc_getsockname_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getsockname(SB)
|
||||
TEXT ·libc_shutdown_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_shutdown(SB)
|
||||
TEXT ·libc_socketpair_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_socketpair(SB)
|
||||
TEXT ·libc_recvfrom_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_recvfrom(SB)
|
||||
TEXT ·libc_sendto_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sendto(SB)
|
||||
TEXT ·libc_recvmsg_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_recvmsg(SB)
|
||||
TEXT ·libc_sendmsg_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sendmsg(SB)
|
||||
TEXT ·libc_kevent_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_kevent(SB)
|
||||
TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_utimes(SB)
|
||||
TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_futimes(SB)
|
||||
TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fcntl(SB)
|
||||
TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ptrace(SB)
|
||||
TEXT ·libc_pipe_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_pipe(SB)
|
||||
TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_kill(SB)
|
||||
TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_access(SB)
|
||||
TEXT ·libc_adjtime_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_adjtime(SB)
|
||||
TEXT ·libc_chdir_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chdir(SB)
|
||||
TEXT ·libc_chflags_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chflags(SB)
|
||||
TEXT ·libc_chmod_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chmod(SB)
|
||||
TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chown(SB)
|
||||
TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chroot(SB)
|
||||
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_close(SB)
|
||||
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_dup(SB)
|
||||
TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_dup2(SB)
|
||||
TEXT ·libc_exchangedata_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_exchangedata(SB)
|
||||
TEXT ·libc_fchdir_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fchdir(SB)
|
||||
TEXT ·libc_fchflags_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fchflags(SB)
|
||||
TEXT ·libc_fchmod_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fchmod(SB)
|
||||
TEXT ·libc_fchown_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fchown(SB)
|
||||
TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_flock(SB)
|
||||
TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fpathconf(SB)
|
||||
TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fstat64(SB)
|
||||
TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fstatfs64(SB)
|
||||
TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fsync(SB)
|
||||
TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ftruncate(SB)
|
||||
TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc___getdirentries64(SB)
|
||||
TEXT ·libc_getdtablesize_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getdtablesize(SB)
|
||||
TEXT ·libc_getegid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getegid(SB)
|
||||
TEXT ·libc_geteuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_geteuid(SB)
|
||||
TEXT ·libc_getgid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getgid(SB)
|
||||
TEXT ·libc_getpgid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpgid(SB)
|
||||
TEXT ·libc_getpgrp_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpgrp(SB)
|
||||
TEXT ·libc_getpid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpid(SB)
|
||||
TEXT ·libc_getppid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getppid(SB)
|
||||
TEXT ·libc_getpriority_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpriority(SB)
|
||||
TEXT ·libc_getrlimit_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getrlimit(SB)
|
||||
TEXT ·libc_getrusage_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getrusage(SB)
|
||||
TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getsid(SB)
|
||||
TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getuid(SB)
|
||||
TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_issetugid(SB)
|
||||
TEXT ·libc_kqueue_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_kqueue(SB)
|
||||
TEXT ·libc_lchown_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_lchown(SB)
|
||||
TEXT ·libc_link_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_link(SB)
|
||||
TEXT ·libc_listen_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_listen(SB)
|
||||
TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_lstat64(SB)
|
||||
TEXT ·libc_mkdir_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mkdir(SB)
|
||||
TEXT ·libc_mkfifo_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mkfifo(SB)
|
||||
TEXT ·libc_mknod_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mknod(SB)
|
||||
TEXT ·libc_mlock_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mlock(SB)
|
||||
TEXT ·libc_mlockall_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mlockall(SB)
|
||||
TEXT ·libc_mprotect_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mprotect(SB)
|
||||
TEXT ·libc_munlock_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_munlock(SB)
|
||||
TEXT ·libc_munlockall_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_munlockall(SB)
|
||||
TEXT ·libc_open_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_open(SB)
|
||||
TEXT ·libc_pathconf_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_pathconf(SB)
|
||||
TEXT ·libc_pread_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_pread(SB)
|
||||
TEXT ·libc_pwrite_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_pwrite(SB)
|
||||
TEXT ·libc_read_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_read(SB)
|
||||
TEXT ·libc_readlink_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_readlink(SB)
|
||||
TEXT ·libc_rename_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_rename(SB)
|
||||
TEXT ·libc_revoke_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_revoke(SB)
|
||||
TEXT ·libc_rmdir_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_rmdir(SB)
|
||||
TEXT ·libc_lseek_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_lseek(SB)
|
||||
TEXT ·libc_select_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_select(SB)
|
||||
TEXT ·libc_setegid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setegid(SB)
|
||||
TEXT ·libc_seteuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_seteuid(SB)
|
||||
TEXT ·libc_setgid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setgid(SB)
|
||||
TEXT ·libc_setlogin_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setlogin(SB)
|
||||
TEXT ·libc_setpgid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setpgid(SB)
|
||||
TEXT ·libc_setpriority_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setpriority(SB)
|
||||
TEXT ·libc_setprivexec_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setprivexec(SB)
|
||||
TEXT ·libc_setregid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setregid(SB)
|
||||
TEXT ·libc_setreuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setreuid(SB)
|
||||
TEXT ·libc_setrlimit_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setrlimit(SB)
|
||||
TEXT ·libc_setsid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setsid(SB)
|
||||
TEXT ·libc_settimeofday_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_settimeofday(SB)
|
||||
TEXT ·libc_setuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setuid(SB)
|
||||
TEXT ·libc_stat64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_stat64(SB)
|
||||
TEXT ·libc_statfs64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_statfs64(SB)
|
||||
TEXT ·libc_symlink_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_symlink(SB)
|
||||
TEXT ·libc_sync_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sync(SB)
|
||||
TEXT ·libc_truncate_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_truncate(SB)
|
||||
TEXT ·libc_umask_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_umask(SB)
|
||||
TEXT ·libc_undelete_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_undelete(SB)
|
||||
TEXT ·libc_unlink_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_unlink(SB)
|
||||
TEXT ·libc_unmount_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_unmount(SB)
|
||||
TEXT ·libc_write_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_write(SB)
|
||||
TEXT ·libc_mmap_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mmap(SB)
|
||||
TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_munmap(SB)
|
||||
TEXT ·libc_fork_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fork(SB)
|
||||
TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ioctl(SB)
|
||||
TEXT ·libc_execve_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_execve(SB)
|
||||
TEXT ·libc_exit_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_exit(SB)
|
||||
TEXT ·libc_sysctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sysctl(SB)
|
||||
TEXT ·libc_writev_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_writev(SB)
|
||||
TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_gettimeofday(SB)
|
File diff suppressed because it is too large
Load Diff
243
src/syscall/zsyscall_darwin_arm64.s
Normal file
243
src/syscall/zsyscall_darwin_arm64.s
Normal file
@ -0,0 +1,243 @@
|
||||
// go run mkasm_darwin.go arm64
|
||||
// Code generated by the command above; DO NOT EDIT.
|
||||
#include "textflag.h"
|
||||
TEXT ·libc_getattrlist_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getattrlist(SB)
|
||||
TEXT ·libc_getfsstat64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getfsstat64(SB)
|
||||
TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setattrlist(SB)
|
||||
TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sendfile(SB)
|
||||
TEXT ·libc_getgroups_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getgroups(SB)
|
||||
TEXT ·libc_setgroups_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setgroups(SB)
|
||||
TEXT ·libc_wait4_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_wait4(SB)
|
||||
TEXT ·libc_accept_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_accept(SB)
|
||||
TEXT ·libc_bind_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_bind(SB)
|
||||
TEXT ·libc_connect_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_connect(SB)
|
||||
TEXT ·libc_socket_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_socket(SB)
|
||||
TEXT ·libc_getsockopt_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getsockopt(SB)
|
||||
TEXT ·libc_setsockopt_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setsockopt(SB)
|
||||
TEXT ·libc_getpeername_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpeername(SB)
|
||||
TEXT ·libc_getsockname_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getsockname(SB)
|
||||
TEXT ·libc_shutdown_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_shutdown(SB)
|
||||
TEXT ·libc_socketpair_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_socketpair(SB)
|
||||
TEXT ·libc_recvfrom_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_recvfrom(SB)
|
||||
TEXT ·libc_sendto_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sendto(SB)
|
||||
TEXT ·libc_recvmsg_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_recvmsg(SB)
|
||||
TEXT ·libc_sendmsg_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sendmsg(SB)
|
||||
TEXT ·libc_kevent_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_kevent(SB)
|
||||
TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_utimes(SB)
|
||||
TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_futimes(SB)
|
||||
TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fcntl(SB)
|
||||
TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ptrace(SB)
|
||||
TEXT ·libc_pipe_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_pipe(SB)
|
||||
TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_kill(SB)
|
||||
TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_access(SB)
|
||||
TEXT ·libc_adjtime_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_adjtime(SB)
|
||||
TEXT ·libc_chdir_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chdir(SB)
|
||||
TEXT ·libc_chflags_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chflags(SB)
|
||||
TEXT ·libc_chmod_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chmod(SB)
|
||||
TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chown(SB)
|
||||
TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chroot(SB)
|
||||
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_close(SB)
|
||||
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_dup(SB)
|
||||
TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_dup2(SB)
|
||||
TEXT ·libc_exchangedata_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_exchangedata(SB)
|
||||
TEXT ·libc_fchdir_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fchdir(SB)
|
||||
TEXT ·libc_fchflags_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fchflags(SB)
|
||||
TEXT ·libc_fchmod_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fchmod(SB)
|
||||
TEXT ·libc_fchown_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fchown(SB)
|
||||
TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_flock(SB)
|
||||
TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fpathconf(SB)
|
||||
TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fstat64(SB)
|
||||
TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fstatfs64(SB)
|
||||
TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fsync(SB)
|
||||
TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ftruncate(SB)
|
||||
TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc___getdirentries64(SB)
|
||||
TEXT ·libc_getdtablesize_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getdtablesize(SB)
|
||||
TEXT ·libc_getegid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getegid(SB)
|
||||
TEXT ·libc_geteuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_geteuid(SB)
|
||||
TEXT ·libc_getgid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getgid(SB)
|
||||
TEXT ·libc_getpgid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpgid(SB)
|
||||
TEXT ·libc_getpgrp_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpgrp(SB)
|
||||
TEXT ·libc_getpid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpid(SB)
|
||||
TEXT ·libc_getppid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getppid(SB)
|
||||
TEXT ·libc_getpriority_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getpriority(SB)
|
||||
TEXT ·libc_getrlimit_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getrlimit(SB)
|
||||
TEXT ·libc_getrusage_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getrusage(SB)
|
||||
TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getsid(SB)
|
||||
TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_getuid(SB)
|
||||
TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_issetugid(SB)
|
||||
TEXT ·libc_kqueue_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_kqueue(SB)
|
||||
TEXT ·libc_lchown_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_lchown(SB)
|
||||
TEXT ·libc_link_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_link(SB)
|
||||
TEXT ·libc_listen_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_listen(SB)
|
||||
TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_lstat64(SB)
|
||||
TEXT ·libc_mkdir_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mkdir(SB)
|
||||
TEXT ·libc_mkfifo_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mkfifo(SB)
|
||||
TEXT ·libc_mknod_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mknod(SB)
|
||||
TEXT ·libc_mlock_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mlock(SB)
|
||||
TEXT ·libc_mlockall_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mlockall(SB)
|
||||
TEXT ·libc_mprotect_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mprotect(SB)
|
||||
TEXT ·libc_munlock_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_munlock(SB)
|
||||
TEXT ·libc_munlockall_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_munlockall(SB)
|
||||
TEXT ·libc_open_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_open(SB)
|
||||
TEXT ·libc_pathconf_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_pathconf(SB)
|
||||
TEXT ·libc_pread_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_pread(SB)
|
||||
TEXT ·libc_pwrite_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_pwrite(SB)
|
||||
TEXT ·libc_read_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_read(SB)
|
||||
TEXT ·libc_readlink_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_readlink(SB)
|
||||
TEXT ·libc_rename_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_rename(SB)
|
||||
TEXT ·libc_revoke_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_revoke(SB)
|
||||
TEXT ·libc_rmdir_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_rmdir(SB)
|
||||
TEXT ·libc_lseek_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_lseek(SB)
|
||||
TEXT ·libc_select_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_select(SB)
|
||||
TEXT ·libc_setegid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setegid(SB)
|
||||
TEXT ·libc_seteuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_seteuid(SB)
|
||||
TEXT ·libc_setgid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setgid(SB)
|
||||
TEXT ·libc_setlogin_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setlogin(SB)
|
||||
TEXT ·libc_setpgid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setpgid(SB)
|
||||
TEXT ·libc_setpriority_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setpriority(SB)
|
||||
TEXT ·libc_setprivexec_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setprivexec(SB)
|
||||
TEXT ·libc_setregid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setregid(SB)
|
||||
TEXT ·libc_setreuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setreuid(SB)
|
||||
TEXT ·libc_setrlimit_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setrlimit(SB)
|
||||
TEXT ·libc_setsid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setsid(SB)
|
||||
TEXT ·libc_settimeofday_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_settimeofday(SB)
|
||||
TEXT ·libc_setuid_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setuid(SB)
|
||||
TEXT ·libc_stat64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_stat64(SB)
|
||||
TEXT ·libc_statfs64_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_statfs64(SB)
|
||||
TEXT ·libc_symlink_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_symlink(SB)
|
||||
TEXT ·libc_sync_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sync(SB)
|
||||
TEXT ·libc_truncate_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_truncate(SB)
|
||||
TEXT ·libc_umask_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_umask(SB)
|
||||
TEXT ·libc_undelete_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_undelete(SB)
|
||||
TEXT ·libc_unlink_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_unlink(SB)
|
||||
TEXT ·libc_unmount_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_unmount(SB)
|
||||
TEXT ·libc_write_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_write(SB)
|
||||
TEXT ·libc_mmap_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_mmap(SB)
|
||||
TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_munmap(SB)
|
||||
TEXT ·libc_fork_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fork(SB)
|
||||
TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ioctl(SB)
|
||||
TEXT ·libc_execve_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_execve(SB)
|
||||
TEXT ·libc_exit_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_exit(SB)
|
||||
TEXT ·libc_sysctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sysctl(SB)
|
||||
TEXT ·libc_writev_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_writev(SB)
|
||||
TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_gettimeofday(SB)
|
Loading…
Reference in New Issue
Block a user