This function returns the current priority for a process (PRIO_PROCESS), process group (PRIO_PGRP) or user (PRIO_USER).
The argument WHICH specifies what entity to set the priority for one of PRIO_PROCESS, PRIO_PGRP, or PRIO_USER, and WHO is the process ID or user ID to set. A value of 0 for WHO defines the current process, process group, or user. This produces a fatal error on systems that don.t support the system getpriority( ) function.
Following is the simple syntax for this function −
getpriority WHICH, WHO
This function returns undef on error otherwise current priority.