basic.%kill
Sends signal to process ID.
Syntax
variable=%kill(pid, signal)
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'.
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
See Also
User Comments
What do you think?
Share your experience or ask a question by using the form below.
Login to leave your comments.
