%kill() function

The %kill() function sends the signal specified in signal to the process pid.

For Windows: Not Supported


var = %kill(pid, signal)


All D3 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 D3 process. Other signals are used internally and can cause problems if used out of context.

SIGTERM Logs off the D3 process and disconnects it.
SIGHUP Logs off the D3 process, but leaves it connected to the D3 virtual machine. This behavior can be modified by providing a user written signal handler.
SIGINT Emulates pressing the BREAK key, possibly sending the D3 process to the debugger.

Signal numbers are defined in dm,bp,unix.h signal.h.

Tip: Signal numbers are very implementation specific. Use the symbols defined in the include file: signal.h.
Warning: Sending a SIGKILL to an active D3 process can create data corruption.


* Get its pid, and send hangup (SIGHUP=1) to it.
if %kill(pid, 1) = -1 then
   print "Cannot logoff process ":pib