basic.%kill C Function/BASIC Program

basic.%kill

Command basic.%kill C Function/BASIC Program
Applicable release versions: AP/Unix
Category BASIC Program (486)
Description sends the signal specified in "signal" to the process "pid".

All Pick processes normally catch signals for their internal use. The built-in "%pgetpid" allows finding the PID of a process by knowing its port.number (pib). Only "SIGUSR2" should be sent to a Pick process. Other signals are used internally and may cause problems if used out of context.

"SIGTERM" will logoff the Pick process and disconnect it.

"SIGHUP" will logoff the Pick process, but leave it connected to the Pick virtual machine. This behavior can be modified by providing a user writtem signal handler. See the 'trap' command.

"SIGINT" will emulate a <BREAK>, possibly sending the Pick process to the debugger.

Signal numbers are defined in "dm,bp,unix.h signal.h".
Syntax variable=%kill(pid, signal)
Options
Example
Get its pid, and send hangup
* (SIGHUP=1) to it.
pib=32
pid=%pgetpid( pib )
if %kill( pid, 1 ) = -1 then
  print "Cannot logoff process ":pib
end
Purpose
Related tcl.trap
tcl.pid
basic.cfunc
basic.%pgetpid
port.number
basic.cfunction
pid
tcl.kill