# Command: kill

NEST HelpDesk | Command Index | NEST Quick Reference

Name:

    kill - send a signal to another process

Synopsis:

    PID  SIGNAL kill ->	-
      PID /SIGNAL kill ->	-

Examples:

    1. 23 /SIGTERM kill %send TERM signal to Process 23

      2. %This is equivalent to 1. :
      signaldict begin
      23 SIGTERM kill
      end

      3. (xterm) 2 system %star an xterm-process
      /SIGKILL kill   %kill it again

Description:

    The "kill" function sends a signal to a process or a group
      of processes specified by "PID". If the signal is zero,
      error checking is performed but no signal is actually sent.
      This can be used to check for a valid PID.
      SIGNAL may be given either as an integer value or as the
      literal name of the signal, as found in "signaldict".

      Alternative: Functions kill_i_i for integer (SIGNAL),
      kill_i_l for literal (SIGNAL) (both undocumented)
      -> behaviour and synopsis are the same.

Parameters:

    In : PID(integer):
      The ID of the process that shall be signalled.
      If "PID" is greater than zero, "SIGNAL" is sent to the
      process whose ID is "PID".
      (If "PID" is negative, "SIGNAL" is sent to all processes
      whose process group ID is equal to the absolute value
      of "PID".	- Process groups are usually used by the
      shell program only.)

      SIGNAL(integer):
      The number of the signal to be sent.
      Signal codes are machine-dependent values, so do not
      rely on any given value! The valid signal codes for
      your machine are compiled into the "signaldict"
      dictionary, where they can be looked up by
      their literal names.
      The only value you may rely on is zero:
      If SIGNAL is zero, error checking is performed
      but no signal is actually sent.
      This can be used to check for a valid PID.

      /SIGNAL(literal):
      The literal name of the signal to be sent.
      This name is automatically looked up in "signaldict"
      and substituted to it's corresponding value prior
      to a call to wait.

      Out: -none-.

Bugs:

    -

Remarks:

    "kill" can be used to send ANY signal, but it's most oftenly used
      to terminate another process. Hence the name.
      Resolution of literal signal names is done by a trie defined
      in file processes.sli.
      Description taken mainly from "POSIX Programmer's Guide",
      D. Lewine, O'Reilly & Assoc. Inc.

Author:

    R Kupper

FirstVersion:

    Apr 27 1999

SeeAlso:

- signaldict
- system
- sysexec
- wait
- waitPID
- spoon
- fork
- getPPID
- getPGRP

Source:

    /opt/conda/conda-bld/nest_1524088722951/work/nest-2.14.0/sli/processes.h

NEST HelpDesk | Command Index | NEST Quick Reference

© 2004 The NEST Initiative