Some work on supporting Windows

This commit is contained in:
AlexSSD7 2023-08-28 11:35:57 +02:00
commit 2f1d4ae60d
9 changed files with 109 additions and 19 deletions

19
vm/os_specifics.go Normal file
View file

@ -0,0 +1,19 @@
//go:build !windows
package vm
import (
"os/exec"
"syscall"
)
func prepareVMCmd(cmd *exec.Cmd) {
// This is to prevent Ctrl+C propagating to the child process.
cmd.SysProcAttr = &syscall.SysProcAttr{
Setpgid: true,
}
}
func terminateProcess(pid int) error {
return syscall.Kill(-pid, syscall.SIGTERM)
}