Enables the setting of a process I/O priority.
short setiopri (ProcessID, IOPriority);
pid_t ProcessID;ushort IOPriority
The setiopri subroutine sets the I/O scheduling priority of all threads in a process to be a constant. If the target process ID does not match the process ID of the caller, the caller must either be running as root or have an effective and real user ID that matches the target process. A smaller value for the IOPriority designates a higher scheduling priority. Only a few I/O devices support priorities.
Item | Description |
---|---|
ProcessID | Specifies the process ID. If this value is -1, the current process I/O scheduling priority is set to a constant. |
IOPriority | Specifies the I/O scheduling priority for the process. The IOPriority parameter must be in the range IOPRIORITY_MIN≤IOPriority<IOPRIORITY_MAX. (See the sys/extendio.h file.) |
Upon successful completion, the setiopri subroutine returns the former I/O scheduling priority of the process just changed. A returned value of IOPRIORITY_UNSET indicates that the I/O priority was not set. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.
Item | Description |
---|---|
EINVAL | IOPriority value is invalid. |
EPERM | The calling process is not root. It does not have the same process ID as the target process, and does not have the same real effective user ID as the target process. |
ESRCH | No process can be found corresponding to the specified ProcessID. |