开发者

getpriority() function in linux

开发者 https://www.devze.com 2022-12-23 09:18 出处:网络
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.. thn

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消