Perl getpriority Function

Advertisements


Description

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.

Syntax

Following is the simple syntax for this function:

getpriority WHICH, WHO

Return Value

This function returns undef on error otherwise current priority.

Example

Following is the example code showing its basic usage:

#!/usr/bin/perl

When above code is executed, it produced following result




Advertisements
Advertisements