Skip to content

Commit

Permalink
Merge pull request #639 from noborus/send-process-group
Browse files Browse the repository at this point in the history
Send SIGSTOP to the process group
  • Loading branch information
noborus authored Oct 25, 2024
2 parents 1990228 + bb2e1fe commit 70b2062
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions oviewer/suspend.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ func registerSIGTSTP() chan os.Signal {
return sigSuspend
}

// suspendProcess sends SIGSTOP signal to itself.
// suspendProcess sends SIGSTOP signal to the process group.
func suspendProcess() error {
pid := syscall.Getpid()
if err := syscall.Kill(pid, syscall.SIGSTOP); err != nil {
return err
}
return nil
pid := syscall.Getpgrp()
return syscall.Kill(-pid, syscall.SIGSTOP)
}

0 comments on commit 70b2062

Please sign in to comment.