Skip to main content

graceful_kill_process_group

Function graceful_kill_process_group 

Source
pub fn graceful_kill_process_group(
    pid: u32,
    initial_signal: KillSignal,
    grace_period: Duration,
) -> GracefulTerminationResult
Expand description

Graceful termination on non-Unix (best effort).

On Windows, uses GenerateConsoleCtrlEvent to send Ctrl+C (SIGINT equivalent) or Ctrl+Break (SIGTERM equivalent) to the process group, followed by TerminateProcess if the process doesn’t exit in time.