ipcKillProcess
ipcKillProcess(o_childId) =>t/nil
Description
Kills the process identified by o_childId. This call results in a UNIX SIGKILL signal being sent to the child process.
When this function is called, it causes the exit status to be 0. If you want that the exit status should be impacted by the termination of the process, use ipcSignalProcess instead.
{
id=ipcBeginProcess("sleep 200")
ipcWaitForProcess(id)
ipcSignalProcess(id 'TERM)
ipcWait(id)
printf("Exit status is %L\n" ipcGetExitStatus(id))
}
Since ipcSignalProcess does not wait for the process to exit, as a result, you should use ipcWait() after using ipcSignalProcess(). This then displays the output as:
Exit status is 143
Arguments
Value Returned
Examples
cid = ipcBeginProcess("sleep 15")
ipc:3
ipcKillProcess(cid)
t
ipcKillProcess(cid) ; The child process has expired already
nil
Related Topics
Interprocess Communication Functions
Return to top