The setpriority callable service sets the scheduling priority of a process, process group, or user.
Operation | Environment |
---|---|
Authorization: | Supervisor or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1SPY): | 31-bit |
AMODE (BPX4SPY): | 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 BPX4SPY with the same parameters.
The PRIO_ constants are defined in the BPXYCONS macro. See BPXYCONS — Constants used by services.
The name of a fullword that contains a value that indicates the exact process ID, process group ID, or user ID whose priority is to be set. The Which parameter indicates how this parameter is to be interpreted. A value of zero for this parameter specifies the current process, process group, or user ID.
The name of a fullword that contains a value that indicates the priority value to which the specific process or group of processes is to be set. This value can be an integer in the range of -20 to 19.
The name of a fullword in which the setpriority service returns a value of zero if successful and -1 if it is not successful.
Return_code | Explanation |
---|---|
EACCES | The priority is being changed to a lower value, and the current process does not have the appropriate privilege (see Authorization) to do so. |
EINVAL | The value of the Which parameter was not recognized; or the value of the Who parameter is not a valid process ID, process group ID or user ID. |
EMVSSAF2ERR | A security product internal error occurred. Consult the Reason_code parameter for the exact reason for the error. |
ENOSYS | The system does not support this function. Your installation chose not to enable this function. |
EPERM | A process was located, but neither the real nor the effective user ID of the calling process matches the effective user ID of the process whose priority is being changed. |
ESRCH | No process could be located using the Which and Who parameter values that were specified. |
The name of a fullword in which the setpriority service stores the reason code. The setpriority 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.
There are no restrictions on the use of the setpriority service.
For an example using this callable service, see BPX1SPY (setpriority) example.