getiopri Subroutine
Purpose
Enables the getting of a process I/O priority.
Syntax
short getiopri (ProcessID);
pid_t ProcessID;
Description
The getiopri subroutine returns the I/O scheduling priority of a process. 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.
Parameters
Item | Description |
---|---|
ProcessID | Specifies the process ID. If this value is -1 ,
the current process scheduling priority is returned. |
Return Values
Upon
successful completion, the getiopri subroutine
returns the I/O scheduling priority of a thread in the process. 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.
Errors
Item | Description |
---|---|
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. |
Implementation Specifics
- Implementation requires an additional field in the proc structure.
- The default setting for process I/O priority is
IOPRIORITY_UNSET
. - Once set, process I/O priorities should be inherited across a fork. I/O priorities should not be inherited across an exec.
- The setiopri system call generates an auditing event using audit_svcstart if auditing is enabled on the system (audit_flag is true).