Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

getpriority(2) OSS System Calls Reference Manual
NAME
getpriority - Gets the OSS process scheduling priority
LIBRARY
G-series native OSS processes: /G/system/sysnn/zossksrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zosskdll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yosskdll
SYNOPSIS
#include <sys/resource.h>
int getpriority(
int which,
id_t who);
PARAMETERS
which Specifies the symbolic value for the source of the nice value to be returned. The
following symbolic values defined in the sys/resource.h header file are valid:
PRIO_PGRP The nice value for the process group should be returned.
PRIO_PROCESS
The nice value for the process should be returned.
PRIO_USER The nice value associated with the user ID should be returned.
who Specifies a numeric value interpreted relative to the which parameter (a process
group ID, an OSS process ID, and a user ID, respectively). A 0 (zero) value for
the who parameter indicates the current process group ID, OSS process ID, or
user ID.
DESCRIPTION
The getpriority() function obtains the nice value of a process group, process, or user ID.
The getpriority() function returns the highest priority (lowest numerical value) pertaining to any
of the specified processes.
Use From the Guardian Environment
This function cannot be called from the Guardian environment. When the getpriority() function
is called from the Guardian environment, the call fails and errno is set to [ENOTOSS].
RETURN VALUES
Because getpriority() can legitimately return the value of -1, set the external variable errno to 0
(zero) before calling the getpriority() function. If a value of -1 is returned from getpriority(),
check errno to see whether an error occurred or the value is a legitimate priority.
Upon successful completion, the getpriority() function returns an integer in the range -20
through 19. Otherwise, the value -1 is returned and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the getpriority() function sets errno to the
corresponding value.
[EINVAL] One of the following conditions occurred:
The value specified by the which parameter is invalid.
The value specified as a process group ID, OSS process ID, or user ID by
the who parameter is out of range.
382 Hewlett-Packard Company 527186-023