ipcSignalProcess
ipcSignalProcess(
o_childId
s_signal
)
=> t / nil
Description
Sends the specified POSIX signal to the specified UNIX/Linux child process.
Arguments
|
o_childId
|
Child process handle obtained when the child process is launched.
|
|
s_signal
|
Symbol identifying the desired signal. It can have the following values:
|
|
|
INT: The interruption signal is sent to a process for requesting its interruption. Although the default POSIX behavior is for the process to be terminated, application-defined behavior may include discontinuing the current task and proceeding to the next task.
|
|
|
TERM: The termination signal is sent to a process for requesting its termination. Unlike the KILL signal, it can be caught and interpreted or ignored by the process. This allows the process to perform termination by releasing resources and saving the state, if appropriate.
|
|
|
QUIT: The quit signal is sent to a process for requesting its termination after performing a core dump. The core dump can be used in conjunction with a debugger to understand the state of the process when the QUIT signal was delivered.
|
|
|
KILL: The kill signal is sent when immediate process termination is required. Unlike TERM and INT, this signal cannot be caught or ignored, and the receiving process cannot perform any clean-up upon receiving this signal. For this reason, TERM is preferred.
|
Value Returned
|
t
|
The child process is still alive.
|
|
nil
|
The child process has already expired.
|
Examples
Send SIGINT to a child process and observe the exitStatus
cid = ipcBeginProcess( "sleep 60" )
=>ipc:1
ipcSignalProcess( cid 'INT )
=>t
cid->exitStatus
130 ; subtract 128 to obtain the signal number (2 is a typical value for SIGINT)
Related Topics
Interprocess Communication Functions
ipcSoftInterrupt
ipcCloseProcess
ipcKillProcess
Return to top