may i know the exact usage of getpriority() call used in lin开发者_StackOverflow中文版ux.. even after searching thru net, i couldnt understand it exactly.. can someone explain it with an example.. thnx in advance :)
The scheduling priority of the process, process group, or user, as
indicated by which and who is obtained with the getpriority call ...
So, it returns a priority. It takes two args.
The first arg tells it how to interpret the second arg.
which is ... one of PRIO_PROCESS,
PRIO_PGRP, or PRIO_USER,
So, if which is PRIO_PROCESS, then 'who' is a process id, if it is PRIO_PGRP, it is a process group id, and if it is PRIO_USER, it is a user ID. A zero of who means the caller.
In the second two cases, the result is to select a set of processes, so it returns the lowest priority number of all of the selected processes.
精彩评论