github.com/LanceLRQ/deer-common@v0.0.9-0.20210319081233-e8222ac018a8/sandbox/forkexec/link_syscall_darwin.go (about)

     1  // +build darwin
     2  
     3  package forkexec
     4  
     5  import (
     6  	"syscall"
     7  	_ "unsafe"
     8  )
     9  
    10  //go:linkname runtime_BeforeFork syscall.runtime_BeforeFork
    11  func runtime_BeforeFork()
    12  
    13  //go:linkname runtime_AfterFork syscall.runtime_AfterFork
    14  func runtime_AfterFork()
    15  
    16  //go:linkname runtime_AfterForkInChild syscall.runtime_AfterForkInChild
    17  func runtime_AfterForkInChild()
    18  
    19  //go:linkname rawSyscall syscall.rawSyscall
    20  func rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)
    21  
    22  //go:linkname libc_fork_trampoline syscall.libc_fork_trampoline
    23  func libc_fork_trampoline()
    24  
    25  //go:linkname libc_setsid_trampoline syscall.libc_setsid_trampoline
    26  func libc_setsid_trampoline()
    27  
    28  //go:linkname libc_setpgid_trampoline syscall.libc_setpgid_trampoline
    29  func libc_setpgid_trampoline()
    30  
    31  //go:linkname libc_getpid_trampoline syscall.libc_getpid_trampoline
    32  func libc_getpid_trampoline()
    33  
    34  //go:linkname libc_ioctl_trampoline syscall.libc_ioctl_trampoline
    35  func libc_ioctl_trampoline()
    36  
    37  //go:linkname libc_chroot_trampoline syscall.libc_chroot_trampoline
    38  func libc_chroot_trampoline()
    39  
    40  //go:linkname libc_setgroups_trampoline syscall.libc_setgroups_trampoline
    41  func libc_setgroups_trampoline()
    42  
    43  //go:linkname libc_setgid_trampoline syscall.libc_setgid_trampoline
    44  func libc_setgid_trampoline()
    45  
    46  //go:linkname libc_setuid_trampoline syscall.libc_setuid_trampoline
    47  func libc_setuid_trampoline()
    48  
    49  //go:linkname libc_chdir_trampoline syscall.libc_chdir_trampoline
    50  func libc_chdir_trampoline()
    51  
    52  //go:linkname libc_dup2_trampoline syscall.libc_dup2_trampoline
    53  func libc_dup2_trampoline()
    54  
    55  //go:linkname libc_fcntl_trampoline syscall.libc_fcntl_trampoline
    56  func libc_fcntl_trampoline()
    57  
    58  //go:linkname libc_close_trampoline syscall.libc_close_trampoline
    59  func libc_close_trampoline()
    60  
    61  //go:linkname libc_execve_trampoline syscall.libc_execve_trampoline
    62  func libc_execve_trampoline()
    63  
    64  //go:linkname libc_write_trampoline syscall.libc_write_trampoline
    65  func libc_write_trampoline()
    66  
    67  //go:linkname libc_exit_trampoline syscall.libc_exit_trampoline
    68  func libc_exit_trampoline()
    69  
    70  //go:linkname libc_read_trampoline syscall.libc_read_trampoline
    71  func libc_read_trampoline()
    72  
    73  //go:linkname libc_setrlimit_trampoline syscall.libc_setrlimit_trampoline
    74  func libc_setrlimit_trampoline()
    75  
    76  //go:linkname fcntl syscall.fcntl
    77  func fcntl(fd int, cmd int, arg int) (val int, err error)
    78  
    79  //go:linkname ptrace1 syscall.ptrace1
    80  func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error)
    81  
    82  //go:linkname readlen syscall.readlen
    83  func readlen(fd int, buf *byte, nbuf int) (n int, err error)