Send a signal to the process. Not implemented on Windows. See signals() for the list of signals on the current platform.

ps_send_signal(p, sig)

Arguments

p

Process handle.

sig

Signal number, see signals().

Details

It checks if the process is still running, before sending the signal, to avoid signalling the wrong process, because of pid reuse.

See also

Examples

px <- processx::process$new("sleep", "10")
p <- ps_handle(px$get_pid())
p
ps_send_signal(p, signals()$SIGINT)
p
ps_is_running(p)
px$get_exit_status()