Product Documentation
Cadence Interprocess Communication SKILL Reference
Product Version IC23.1, June 2023

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

o_childId

Child process handle.

Value Returned

t

The child process is successfully killed.

nil

The child process has already expired.

Examples

      cid = ipcBeginProcess("sleep 15")
ipc:3
ipcKillProcess(cid)
t
ipcKillProcess(cid) ; The child process has expired already
nil

Related Topics

Interprocess Communication Functions

ipcKillAllProcesses


Return to top
 ⠀
X