The __pid_affinity service adds or deletes an entry in a process's affinity list. When a process terminates, each process in its affinity list is notified (sent a signal) of the event. The __pid_affinity service dynamically creates or breaks an association between two processes. Its function is similar to the notification mechanism between parent and child processes, except that in this case the processes are not related in any way.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1PAF): | 31-bit |
AMODE (BPX4PAF): | 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 BPX4PAF with the same parameters.
The name of a fullword that specifies a numeric value that identifies the function to be performed. The following Function_code constants are defined by the BPXYCONS macro (see BPXYCONS — Constants used by services):
Constant | Function |
---|---|
PAF_ADD_PID# | The process and associated signal that are specified by Signal_Pid are to be added to the affinity list of the process that is specified by Target_Pid. |
PAF_DELETE_PID# | The process and associated signal that are specified by Signal_Pid are to be deleted from the affinity list of the process that is specified by Target_Pid. |
The name of a fullword that specifies a numeric value that identifies the PID (Process ID) of the process whose affinity list is to be altered. See the usage notes for limitations on the PIDs that can be specified.
The name of a fullword that specifies a numeric value that identifies the PID (Process ID) of the process that, when the Target_Pid process terminates, is to be sent the signal that is specified by the Signal parameter. See the usage notes for limitations on the PIDs that can be specified.
The name of a fullword that specifies a numeric value that identifies the signal that the Signal_Pid process is to receive when the process that is specified by Target_Pid terminates. The signal must be one that is defined by the BPXYSIGH macro.
The name of a fullword in which the __pid_affinity service returns 0 if the request is successful, or -1 if it is not successful.
The name of a fullword in which the __pid_affinity service stores the return code. The __pid_affinity service returns Return_code only if Return_value is -1. For a complete list of possible return code values, see z/OS UNIX System Services Messages and Codes. The __pid_affinity service can return one of the following values in the Return_code parameter:
Return_code | Explanation |
---|---|
EINVAL | One or more of the following conditions were detected:
The following reason codes can accompany the return code: JRInvalidSignal, JRTargetPid, JRPidsSame, and JRSignalPid. |
EPERM | The caller does not have permission to send a signal to the process that is specified on the Signal_Pid parameter. |
EMVSSAF2ERR | A System Authorization Facility (SAF) or RACF® call had an error. |
ESRCH | One or more of the following conditions were detected:
The following reason codes can accompany the return code: JRTargetPid and JRSignalPid. |
The name of a fullword in which the __pid_affinity service stores the reason code. The __pid_affinity 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.
In the case of EMVSSAF2ERR, Reason_code contains the RACF return and reason codes, respectively, in the two low-order bytes. For a more detailed description of the RACF Check Privilege service return and reason code values, see the following table:
RACF return code | RACF reason code | Explanation |
---|---|---|
8 | 4 | The caller is not the owner of the target process. |
8 | 12 | There was an internal error during RACF processing. |
None.
For an example using this callable service, see BPX1PAF (__pid_affinity) example.