1% Generated by roxygen2: do not edit by hand 2% Please edit documentation in R/low-level.R 3\name{ps_kill} 4\alias{ps_kill} 5\title{Kill a process} 6\usage{ 7ps_kill(p = ps_handle()) 8} 9\arguments{ 10\item{p}{Process handle.} 11} 12\description{ 13Kill the current process with SIGKILL preemptively checking 14whether PID has been reused. On Windows it uses \code{TerminateProcess()}. 15} 16\examples{ 17\dontshow{if (ps::ps_is_supported() && ps::ps_os_type()["POSIX"] && ! ps:::is_cran_check()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 18px <- processx::process$new("sleep", "10") 19p <- ps_handle(px$get_pid()) 20p 21ps_kill(p) 22p 23ps_is_running(p) 24px$get_exit_status() 25\dontshow{\}) # examplesIf} 26} 27\seealso{ 28Other process handle functions: 29\code{\link{ps_children}()}, 30\code{\link{ps_cmdline}()}, 31\code{\link{ps_connections}()}, 32\code{\link{ps_cpu_times}()}, 33\code{\link{ps_create_time}()}, 34\code{\link{ps_cwd}()}, 35\code{\link{ps_descent}()}, 36\code{\link{ps_environ}()}, 37\code{\link{ps_exe}()}, 38\code{\link{ps_handle}()}, 39\code{\link{ps_interrupt}()}, 40\code{\link{ps_is_running}()}, 41\code{\link{ps_memory_info}()}, 42\code{\link{ps_name}()}, 43\code{\link{ps_num_fds}()}, 44\code{\link{ps_num_threads}()}, 45\code{\link{ps_open_files}()}, 46\code{\link{ps_pid}()}, 47\code{\link{ps_ppid}()}, 48\code{\link{ps_resume}()}, 49\code{\link{ps_send_signal}()}, 50\code{\link{ps_shared_libs}()}, 51\code{\link{ps_status}()}, 52\code{\link{ps_suspend}()}, 53\code{\link{ps_terminal}()}, 54\code{\link{ps_terminate}()}, 55\code{\link{ps_uids}()}, 56\code{\link{ps_username}()} 57} 58\concept{process handle functions} 59