| kill {fork} | R Documentation |
kill sends a signal to a process. killall sends a
signal to all processes forked during the current session.
kill(pid, signal = 15) killall(signal = 15)
pid |
Process ID for the target process |
signal |
Signal number to send. Defaults to 9 (SIGKILL) |
The kill function provides a thin wrapper around the Unix
"kill" system call, which sends a signal to the specified process. The
killall function sends a signal to all processes which have
been forked during the current session.
Refer to the local Unix man pages for details.
kill returns 0 on successful completion, -1 on errors.
killall does not return a value.
Gregory R. Warnes greg@random-technologies-llc.com
"kill" and "waitpid" man pages
getpid, exit, wait,
kill, killall
# start a process that just sleeps for 10 seconds
sleepy <- function()
{
cat("Going to sleep..")
Sys.sleep(10)
cat("Woke up!")
}
pid <- fork( sleepy )
# kill the sleeping process
kill(pid)