Syntax | #include <sys/resource.h> int getpriority(int which, id_t who); int setpriority(int which, id_t who, int priority); |
Description getpriority()
retrieves the current scheduling priority of the process, the process group
or the user.
The arguments which and who define which process is addressed. which can take the
The default priority is 0; lower priorities mean improved scheduling. If the priority is below Only users with the appropriate authorization can reduce priorities. When threads are used, the
| ||
Return val. |
-20 ≤ return value ≤ 20 | |
if successful. | ||
-1 | if an error occurs. | |
| ||
0 | if successful. |
| ||
| No process was found to which the specified values which and who apply. | |
| ||
| A process was found but neither the effective user ID nor the real one | |
| An attempt was made to set the priority to a lower value, which means a | |
Notes | What effect the changing of the scheduling priority has depends on the algorithm of the As | |
See also |
|