PSTAT Interfaces

2
4.21 pstat_getstable().................................................................................................................. 24
4.22 pstat_getstatic()................................................................................................................... 24
4.23 pstat_getstream() ................................................................................................................ 25
4.24 pstat_getswap() ................................................................................................................... 26
4.25 pstat_getvminfo()................................................................................................................ 26
5. Binary Compatibility................................................................................................................ 27
6. Appendix................................................................................................................................... 28
1. Introduction
1.1 Abstract
Pstat is a supported Application Programming Interface (API) that provides many HP-UX
system contexts. It provides a number of wrappers (pstat_get*) and corresponding structures
(struct pst_*) to get information from the kernel. These interfaces are designed in such a way to
allow future expansion of the interface, while preserving source and binary compatibility for
programs written using the pstat interfaces. Pstat interfaces are available in both 64-bit and 32-bit
versions.
Today, many applications read kernel data structures through unsupported interfaces,
such as the /dev/kmem pseudo driver, to get information about open files, resource usage,
process activity etc. Because kernel data structures change from release to release, this access
method is fragile, incurring a high maintenance cost. Replacing such access methods with calls
to the pstat() system call will insulate these applications from the release-to-release variability in
private kernel data structures and eliminate the need to re-release these applications with each
new HP-UX release.
1.2 Purpose of Document
The purpose of this document is to communicate the availability of pstat interfaces and to
give developers guidance on how to take advantage of these supported interfaces. It provides
code examples to demonstrate the calling conventions.
1.3 Intended Audience
This document is intended for HP-UX software developers, system administrators, and end
users, both internal and external to Hewlett-Packard.
1.4 Structure of Document
The document is structured as follows. Section 2 provides an overview of pstat. Section 3
provides a summary of the system contexts available through pstat. Each of the pstat wrappers is
described in detail in Section 4. Code examples that demonstrate the usage of pstat wrappers are
also included. Section 5 explains how pstat supports binary compatibility. Each of the available
contexts is explained in detail in Section 6.
1.5 Related Documentation
Man page for pstat()
Header files <sys/pstat.h> and <sys/pstat/*.h>