setpriority man page on DigitalUNIX

Man page or keyword search:  
man Server   12896 pages
apropos Keyword Search (all sections)
Output format
DigitalUNIX logo
[printable version]

getpriority(2)							getpriority(2)

       getpriority, setpriority - Get or set process scheduling priority

       #include <sys/resource.h>

       int getpriority(
	       int which,
	       id_t who ); int setpriority(
	       int which,
	       id_t who,
	       int priority) );

       [Tru64  UNIX]  The  following declaration of the who parameter for get‐
       priority() and setpriority() does not conform to current standards  and
       is supported only for backward compatibility:

       int who

       Interfaces  documented on this reference page conform to industry stan‐
       dards as follows:

       getpriority(), setpriority(): XSH4.2, XSH5.0

       Refer to the standards(5) reference page	 for  more  information	 about
       industry standards and associated tags.

       Specifies  one  of  PRIO_PROCESS (process priority), PRIO_PGRP (process
       group priority), or PRIO_USER (user  priority).	 Specifies  a  numeric
       value  interpreted  relative  to the which parameter (a process identi‐
       fier, process group identifier, and a  user  ID,	 respectively).	  A  0
       (zero) value for the who parameter denotes the current process, process
       group, or user.	Specifies a value in the range -20 to 20. The  default
       priority is 0 (zero); negative priorities cause more favorable schedul‐

       The getpriority() function obtains the current priority of  a  process,
       process	group, or user. The getpriority() function returns the highest
       priority (lowest numerical value) pertaining to any  of	the  specified

       The  setpriority()  function sets the scheduling priority of a process,
       process group, or user. If you specify more than one process, the  set‐
       priority()  function  sets  the priorities of all of the specified pro‐
       cesses to the specified value.  If the specified	 value	is  less  than
       -20, a value of -20 is used; if it is greater than 20, a value of 20 is

       Upon successful completion, the getpriority() function returns an inte‐
       ger  in the range -20 to 20. Otherwise, -1 is returned and errno is set
       to indicated the error.

       Because getpriority() can legitimately return the value -1, it is  nec‐
       essary  to  clear  the  external variable errno prior to the call, then
       check it afterward to determine if -1  is  an  error  or	 a  legitimate

       Upon  successful	 completion,  the  setpriority()  function  returns  0
       (zero). Otherwise, the function returns -1 and sets errno  to  indicate
       the error.

       The  getpriority()  and setpriority() functions set errno to the speci‐
       fied values for the following conditions: No process was located	 using
       the  specified which and who parameter values.  The which parameter was
       not recognized.

       In addition to the errors indicated above, the  setpriority()  function
       can  fail  with	errno  set to one of the following values: The process
       does not have ownership rights with respect  to	the  target  process's
       real user ID.  The process is trying to raise its priority and does not
       have the appropriate privilege.

       Functions: exec(2), nice(3)

       Standards: standards(5)


List of man pages available for DigitalUNIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net