Files
nmon/internal/vmsup/proc_linux.go

17 lines
471 B
Go

//go:build linux
package vmsup
import (
"syscall"
)
// sysProcAttr puts the child in its own process group and has the kernel kill
// it if nmon dies. Pdeathsig fires when the thread that forked exits, so the
// supervisor goroutine that starts children stays locked to its thread.
func sysProcAttr() *syscall.SysProcAttr {
return &syscall.SysProcAttr{Setpgid: true, Pdeathsig: syscall.SIGKILL}
}
func killGroup(pid int) { _ = syscall.Kill(-pid, syscall.SIGKILL) }