github.com/LanceLRQ/deer-common@v0.0.9-0.20210319081233-e8222ac018a8/sandbox/forkexec/link_syscall_linux.go (about) 1 // +build linux 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 formatIDMappings syscall.formatIDMappings 20 func formatIDMappings(idMap []syscall.SysProcIDMap) []byte 21 22 //go:linkname writeIDMappings syscall.writeIDMappings 23 func writeIDMappings(path string, idMap []syscall.SysProcIDMap) error 24 25 //go:linkname writeSetgroups syscall.writeSetgroups 26 func writeSetgroups(pid int, enable bool) error 27 28 //go:linkname rawSyscallNoError syscall.rawSyscallNoError 29 func rawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 30 31 //go:linkname rawVforkSyscall syscall.rawVforkSyscall 32 func rawVforkSyscall(trap, a1 uintptr) (r1 uintptr, err syscall.Errno)