HP-UX 11i Release Notes (December 2000)
Programming
Extensions to pstat(2)
Chapter 13 249
Extensions to pstat(2)
This extension provides new functionality to the pstat() system call
that enables various system management and measurement tools to
eliminate their dependency on the /dev/kmem pseudo-driver.
Today, many system management and measurement tools read kernel
data structures through unsupported interfaces, such as the /dev/kmem
pseudo-driver, to get information about open files, resource usage,
process activity, and so on. Because kernel data structures change from
release to release, this access method is fragile, incurring a high
maintenance cost. To insulate these applications from the
release-to-release variability in private kernel data structures, HP-UX
11i provides the enhanced pstat system call and a new set of wrappers.
The pstat interface is designed to allow future expansion of the interface,
while preserving source and binary compatibility of programs written
using pstat wrappers. The pstat interface is available in both 64-bit and
32-bit versions. Replacing the /dev/kmem access with calls to pstat
wrappers will eliminate the need to re-release applications with each
new HP-UX release.
Currently, the pstat() system call provides information about various
system contexts, such as static, dynamic, virtual memory, process, open
files, etc. HP-UX provides a number of libc wrappers (pstat_get()*)
and corresponding structures (struct pst_()*) to get information
from the kernel using pstat(). As part of this enhancement, new
pstat() wrappers and corresponding structures are added and some
existing ones are extended.
Compatibility is significantly improved by introducing a well
documented interface that guarantees binary compatibility for kernel
intrusive applications between releases. There is no impact to legacy
behavior of current pstat() services.
There is no impact to application performance as compared to obtaining
the data from /dev/kmem. No impact to system performance is expected
from these pstat extensions.
NOTE This release includes an enhanced version of pstat(). This version
repairs some existing defects by adding more fields in pst_status struct
to return process children usage information. The pstat (2) manpage