United States-English |
|
|
HP-UX Reference > Ggetpriority(2)HP-UX 11i Version 3: February 2007 |
|
NAMEgetpriority, setpriority — get or set process priority SYNOPSIS#include <sys/resource.h> int getpriority(int which, int who); int setpriority(int which, int who, int priority); DESCRIPTIONgetpriority() returns the priority of the indicated processes. setpriority() sets the priority of the indicated processes to priority. The processes are indicated by which and who, where which can have one of the following values:
If more than one process is indicated, the value returned by getpriority() is the lowest valued priority of all the indicated processes, and setpriority() sets the priority of all indicated processes. priority is a value from -20 to 20, where lower values indicate better priorities. The default priority for a process is 0. If the calling process contains more than one thread or lightweight process (i.e., the process is multi-threaded) these functions shall apply to all threads or lightweight processes in the calling process. The priority specified (or retrieved) is the same for all threads or lightweight processes in a process. Negative priorities require appropriate privileges. Security RestrictionsThese system calls are subject to compartmental restrictions which restrict their access to processes in other compartments. This restriction covers getpriority for querying the priority of processes in other compartments, and setpriority for changing the priority of processes in other compartments. See compartments(5) for more information about compartmentalization on systems that support that feature. Compartmental restrictions can be overridden if the process has the COMMALLOWED privilege (PRIV_COMMALLOWED). Processes owned by the superuser may not have this privilege. Processes owned by any user may have this privilege, depending on system configuration. setpriority requires the OWNER privilege (PRIV_OWNER) to change the priority of a process whose uid does not match the caller's real or effective uid.. Processes owned by the superuser have this privilege. Processes owned by other users may have this privilege, depending on system configuration. setpriority requires the LIMIT privilege (PRIV_LIMIT). Processes owned by the superuser have this privilege. Processes owned by other users may have this privilege, depending on system configuration. RETURN VALUEgetpriority() returns the following values:
setpriority() returns the following values:
ERRORSIf getpriority() or setpriority() fails, errno is set to one of the following values:
|
Printable version | ||
|