kill                  package:fork                  R Documentation

_S_e_n_d _a _s_i_g_n_a_l _t_o _o_n_e _o_r _m_o_r_e _p_r_o_c_e_s_s_e_s.

_D_e_s_c_r_i_p_t_i_o_n:

     'kill' sends a signal to a process.  'killall' sends a signal to
     all processes 'fork'ed during the current session.

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

     pid: Process ID for the target process

  signal: Signal number to send.  Defaults to 9 (SIGKILL)

_D_e_t_a_i_l_s:

     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.

_V_a_l_u_e:

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

_A_u_t_h_o_r(_s):

     Gregory R. Warnes gregory_r_warnes\@groton.pfizer.com

_R_e_f_e_r_e_n_c_e_s:

     "kill" and "waitpid"  man pages

_S_e_e _A_l_s_o:

     'getpid', 'exit', 'wait', 'kill', 'killall'

_E_x_a_m_p_l_e_s:

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

