syscall(linux):use clone as go instead fork

This commit is contained in:
luoliwoshang
2025-01-17 08:42:38 +00:00
parent ce26637410
commit 1b536bf5f8
2 changed files with 33 additions and 23 deletions

View File

@@ -276,6 +276,20 @@ func Getpid() PidT
//go:linkname Getppid C.getppid
func Getppid() PidT
// Invoke `system call' number SYSNO, passing it the remaining arguments.
// This is completely system-dependent, and not often useful.
// In Unix, `syscall' sets `errno' for all errors and most calls return -1
// for errors; in many systems you cannot pass arguments or get return
// values for all system calls (`pipe', `fork', and `getppid' typically
// among them).
// In Mach, all system calls take normal arguments and always return an
// error code (zero for success).
//
//go:linkname Syscall C.syscall
func Syscall(sysno c.Long, __llgo_va_list ...any) c.Long
//go:linkname Kill C.kill
func Kill(pid PidT, sig c.Int) c.Int