kill {fork}R Documentation

Send a signal to one or more processes.

Description

kill sends a signal to a process. killall sends a signal to all processes forked during the current session.

Usage

kill(pid, signal = 15)
killall(signal = 15)

Arguments

pid Process ID for the target process
signal Signal number to send. Defaults to 9 (SIGKILL)

Details

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.

Value

kill returns 0 on successful completion, -1 on errors. killall does not return a value.

Author(s)

Gregory R. Warnes greg@random-technologies-llc.com

References

"kill" and "waitpid" man pages

See Also

getpid, exit, wait, kill, killall

Examples


   # 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)


[Package fork version 1.2.1 Index]