The kill callable service sends a signal to a process, a process group, or all processes in the system to which the caller has permission to send a signal.
Note that when a caller with appropriate privileges (see Authorization) specifies a pid equal to -1, the signal will normally be sent to all processes in the system, excluding the init process (process ID 1). If the signal action is to terminate the process, all processes will terminate. This may not be the desired action, considering that some processes may be necessary for the continued operation of the system.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1KIL): | 31-bit |
AMODE (BPX4KIL): | 64-bit |
ASC mode: | Primary mode |
Interrupt status: | Enabled for interrupts |
Locks: | Unlocked |
Control parameters: | All parameters must be addressable by the caller and in the primary address space. |
|
AMODE 64 callers use BPX4KIL with the same parameters.
For more information, see Characteristics and restrictions.
The name of a fullword that contains the signal number to be sent to the processes that are indicated by the Process_ID parameter. The signal number must be defined in the BPXYSIGH macro, or 0.
If the signal is 0, error checking takes place, but no signal is sent. Use a signal value of 0 to verify that the Process_ID parameter is correct before actually sending a signal. This method does not verify permission to send the signal to the specified Process_ID.
The name of a fullword in which the kill service returns 0 if it has permission to send the specified signal to any of the processes specified by the Process_ID parameter. A return value of 0 means that a signal was sent (or could have been sent, if the signal value was 0) to at least one of the specified processes.
If no signal is sent, -1 is returned.
Return_code | Explanation |
---|---|
EINVAL | The value of Signal is incorrect, or is not the number of a supported signal. |
EMVSSAF2ERR | The caller does not have the appropriate RACF® permissions. |
EPERM | The caller does not have permission to send the signal to any process that was specified by the Process_ID parameter. |
ESRCH | No processes or process groups that correspond to Process_ID were found. |
The name of a fullword in which the kill service stores the reason code. The kill service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.
Security Product Return Code | Security Product Reason Code | Explanation |
---|---|---|
8 | 4 | The caller is not the owner of the target process. |
8 | 12 | There was an internal error during security product processing. |
Permissions are discussed in Authorization.
For an example using this callable service, see BPX1KIL (kill) example.
For signal information, see The relationship of z/OS UNIX signals to callable services.