HP-UX Reference (11i v1 05/09) - 2 System Calls (vol 5)

p
pstat(2) pstat(2)
pst_hi_nodeid and pst_lo_nodeid
. The members pst_boundaddr
and
pst_remaddr contain data of the form struct sockaddr, sockaddr_un,
sockaddr_in, sockaddr_in6
, etc. depending on the socket family.
pstat_getstable()
Returns information contained in the system’s stable storage area. There is one global
instance of this context. Data, up to a maximum of
elemsize bytes, are returned in the
struct pst_stable pointed to by buf. The
elemcount parameter must be 1. The
index parameter must be 0.
pstat_getstatic()
Returns static information about the system. This data does not vary while the system is
running. There is one global instance of this context. Data, up to a maximum of
elem-
size
bytes, are returned in the struct pst_static
pointed to by buf. The elem-
count
parameter must be 1. The index parameter must be 0.
pstat_getstream()
Returns detailed information specific to a stream. For the specified stream, there is one
instance of this context for the stream head, each module, and the driver. For each call,
data up to a maximum of elemsize bytes are returned in the structs pst_stream
pointed to by buf. The elemcount parameter specifies the number of structs
pst_stream that are available at buf to be filled in. The moduleskip parameter
indicates the number of modules to skip before returning information about any modules.
Head information is returned for every call. The fid parameter uniquely identifies the
file. This id is obtained from calls to pstat_getfile()
or pstat_getfile2().
On success, the function returns the number of structures returned starting at the location
specified by
buf. This is at least 1 as the head information is always returned. On failure,
the value of -1 is returned and errno is set indicating the cause of the failure.
Use of this function is limited to UID==0 or effective UID match. Please refer
pstat_getfiledetails()
call for more information on Effective UID match.
The
type field can be PS_STR_HEAD ,PS_STR_MODULE
or PS_STR_DRIVER. The
union
val in pst_stream structure will represent the structures head, module,or
driver in the respective cases. If the flag PS_STR_ISACLONE
is set in pst_flag for
head, the field pst_dev_seq in head represents the clone driver sequence number for
the stream.
pstat_getswap()
Returns information specific to a particular swap area. There is one instance of this context
for each swap area (block or filesystem) configured into the system. For each instance
requested, data, up to a maximum of elemsize bytes, are returned in the structs
pst_swapinfo pointed to by buf. The elemcount parameter specifies the number of
structs pst_swapinfo that are available at buf to be filled in. The index parame-
ter specifies the starting index within the context of swap areas.
pstat_getvminfo()
Returns information about the virtual memory subsystem. There is one global instance of
this context. Data, up to a maximum of
elemsize bytes, are returned in the struct
pst_vminfo
pointed to by buf. The elemcount parameter must be 1. The index
parameter must be 0.
Notes
A wide (64 bit) version of the pstat interfaces are available for narrow (32 bit) applications to use. A nar-
row application could use the flag -D_PSTAT64 at compile time to switch to the wide interfaces. Using
this compiler flag in a narrow application is equivalent to using the default interfaces on a wide system.
Refer to the pstat header file to see how the various structures would look like when the -D_PSTAT64
flag is used.
The pstat_getlwp , pstat_getcrashinfo, pstat_getcrashdev
, and pstat_getnode
interfaces are available only in the wide mode and for applications written in standard C and extended
ANSI.
HP-UX 11i Version 1: September 2005 8 Hewlett-Packard Company Section 2245