mirror of
https://github.com/wso2/open-mcp-auth-proxy.git
synced 2025-08-18 12:19:56 +00:00
Handle spawning subprocess within windows
This commit is contained in:
parent
ad5185ad72
commit
68015ae8fc
5 changed files with 167 additions and 52 deletions
23
internal/subprocess/manager_unix.go
Normal file
23
internal/subprocess/manager_unix.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
//go:build !windows
|
||||
|
||||
package subprocess
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// setProcAttr sets Unix-specific process attributes
|
||||
func setProcAttr(cmd *exec.Cmd) {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
|
||||
}
|
||||
|
||||
// getProcessGroup gets the process group ID on Unix systems
|
||||
func getProcessGroup(pid int) (int, error) {
|
||||
return syscall.Getpgid(pid)
|
||||
}
|
||||
|
||||
// killProcessGroup kills a process group on Unix systems
|
||||
func killProcessGroup(pgid int, signal syscall.Signal) error {
|
||||
return syscall.Kill(-pgid, signal)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue