[ Operating System | Reference Manual | Alphabetic Index ]
kill(+Pid, +Signal)
Send the signal Signal to the process number Pid
- Pid
- Integer
- Signal
- Integer
Description
   Send the signal number Signal to the process with process ID Pid.  This
   predicate is an interface to the UNIX system call kill(2).
   If Signal is 0, then only a check for existence of the process is
   performed.  In this case, kill/2 fails if the process does not exist.
Modes and Determinism
Fail Conditions
Fails if Signal is 0 and process Pid does not exist
Exceptions
- (4) instantiation fault 
- Pid or Signal are not instantiated.
- (5) type error 
- Pid or Signal are instantiated to non-integers.
- (170) system interface error 
- Pid or Signal has an invalid value.
- (170) system interface error 
- The process Pid belongs to another user.
Examples
Success:
      [eclipse]: get_flag(pid, Pid), kill(Pid, 31).
      Signal 31
      Pid = 2929
      yes.
      [eclipse]: kill(2929, 0)
      yes.
Failure:
      [eclipse]: kill(9999, 0)
      no.
See Also
exec / 2, exec / 3, exec_group / 3, get_flag / 2, wait / 2