fork bomb handling and gdb support
All checks were successful
Release / Build & publish (push) Successful in 7s
All checks were successful
Release / Build & publish (push) Successful in 7s
This commit is contained in:
18
runner/process_unix.go
Normal file
18
runner/process_unix.go
Normal file
@@ -0,0 +1,18 @@
|
||||
//go:build !windows
|
||||
|
||||
package runner
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func setProcessGroup(cmd *exec.Cmd) {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
|
||||
}
|
||||
|
||||
func killProcessGroup(cmd *exec.Cmd) {
|
||||
if cmd.Process != nil {
|
||||
syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user