home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / getpriority.z / getpriority
Encoding:
Text File  |  2002-10-03  |  3.9 KB  |  67 lines

  1.  
  2.  
  3.  
  4. GGGGEEEETTTTPPPPRRRRIIIIOOOORRRRIIIITTTTYYYY((((2222))))                                                  GGGGEEEETTTTPPPPRRRRIIIIOOOORRRRIIIITTTTYYYY((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      getpriority, setpriority - get/set program scheduling priority
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////rrrreeeessssoooouuuurrrrcccceeee....hhhh>>>>
  13.  
  14.      iiiinnnntttt ggggeeeettttpppprrrriiiioooorrrriiiittttyyyy ((((iiiinnnntttt wwwwhhhhiiiicccchhhh,,,, iiiidddd____tttt wwwwhhhhoooo))));;;;
  15.  
  16.      iiiinnnntttt sssseeeettttpppprrrriiiioooorrrriiiittttyyyy ((((iiiinnnntttt wwwwhhhhiiiicccchhhh,,,, iiiidddd____tttt wwwwhhhhoooo,,,, iiiinnnntttt pppprrrriiiioooo))));;;;
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      The scheduling priority of the process, process group, or user, as
  20.      indicated by _w_h_i_c_h and _w_h_o is obtained with the _g_e_t_p_r_i_o_r_i_t_y call and set
  21.      with the _s_e_t_p_r_i_o_r_i_t_y call.  _W_h_i_c_h is one of PPPPRRRRIIIIOOOO____PPPPRRRROOOOCCCCEEEESSSSSSSS, PPPPRRRRIIIIOOOO____PPPPGGGGRRRRPPPP, or
  22.      PPPPRRRRIIIIOOOO____UUUUSSSSEEEERRRR, and _w_h_o is interpreted relative to _w_h_i_c_h (a process identifier
  23.      for PPPPRRRRIIIIOOOO____PPPPRRRROOOOCCCCEEEESSSSSSSS, process group identifier for PPPPRRRRIIIIOOOO____PPPPGGGGRRRRPPPP, and a user ID
  24.      for PPPPRRRRIIIIOOOO____UUUUSSSSEEEERRRR).  A zero value of _w_h_o denotes the current process, process
  25.      group, or user.  _P_r_i_o is a value in the range -20 to 20.  The default
  26.      priority is 0; lower priorities cause more favorable scheduling.
  27.  
  28.      The _g_e_t_p_r_i_o_r_i_t_y call returns the highest priority (lowest numerical
  29.      value) enjoyed by any of the specified processes.  The _s_e_t_p_r_i_o_r_i_t_y call
  30.      sets the priorities of all of the specified processes to the specified
  31.      value.  Only the super-user may lower priorities.
  32.  
  33.      _g_e_t_p_r_i_o_r_i_t_y and _s_e_t_p_r_i_o_r_i_t_y may return one of the following errors:
  34.  
  35.      [ESRCH]        No process was located using the _w_h_i_c_h and _w_h_o values
  36.                     specified.
  37.  
  38.      [EINVAL]       _W_h_i_c_h was not one of PRIO_PROCESS, PRIO_PGRP, or
  39.                     PRIO_USER.
  40.  
  41.      In addition to the errors indicated above, _s_e_t_p_r_i_o_r_i_t_y may fail with one
  42.      of the following errors returned:
  43.  
  44.      [EPERM]        A process was located, but neither its effective nor real
  45.                     user ID matched the effective user ID of the caller.
  46.  
  47.      [EACCES]       A non super-user attempted to lower a process priority.
  48.  
  49. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  50.      renice(1M), fork(2), nice(1), schedctl(2).
  51.  
  52. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  53.      Since _g_e_t_p_r_i_o_r_i_t_y can legitimately return the value -1, it is necessary
  54.      to clear the external variable _e_r_r_n_o prior to the call, then check it
  55.      afterward to determine if a -1 is an error or a legitimate value.  The
  56.      _s_e_t_p_r_i_o_r_i_t_y call returns 0 if there is no error, or -1 if there is.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.