Sends a signal to a process. The format for the $ZSIGPROC function is:
$ZSIGPROC(expr1,expr2)
The first expression is the pid of the process to which the signal is to be sent.
The second expression is the system signal number. Because a signal number of a signal name can be different for various platforms, FIS recommends using signal names to maintain code portability across different platforms. For example, the signal number for SIGUSR1 is 10 on Linux, 30 on AIX, and 16 for some other platforms. Use the $>mposix.signalval(signame,.sigval) function available in the gtmposix plugin to determine the signal number of a signal name.
If the second expression is 0, $ZSIGPROC() checks the validity of the pid specified in the first expression.
There are four possible return values from $ZSIGPROC():
Return codes/POSIX Error Definitions |
Description |
---|---|
0 |
The specified signal number was successfully sent to the specified pid. Any return value other than 0 indicates an error. |
EPERM |
The process has insufficient permissions to send the signal to the specified pid. |
ESRCH |
The specified pid does not exist. |
EINVAL |
Invalid expression(s). |
Caution | |
---|---|
Although $ZSIGPROC() may work today as a way to invoke the asynchronous interrupt mechanism of GT.M processes to XECUTE $ZINTERRUPT because the underlying mechanism uses the POSIX USR1 signal, FIS reserves the right to change the underlying mechanism to suit its convenience and sending a POSIX USR1 may cease to work as a way to invoke the asynchronous interrupt mechanism. Use MUPIP INTRPT as the supported and stable API to invoke the asynchronous interrupt mechanism. |