%KILL

%KILL


%IOCTL Index Level %LISTEN
Syntax variable = %KILL( pid, signal )
Category BASIC
Type C Function
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".
Options
See Also trap pid c function %PGETPID port.number CFUNCTION pid kill (D3/Unix)
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
Warnings Signal numbers are very implementation specific. Use the symbols defined in the include "signal.h".
Sending a SIGKILL to an active Pick process may create data corruption.
Compatibility D3/Unix
%IOCTL Index Level %LISTEN