HP-UX Reference (11i v2 03/08) - 2 System Calls (vol 5)
p
pstat(2) pstat(2)
match.
On success, the function returns
1. On failure, the value of
-1 is returned and errno is
set indicating the cause of the failure. For AF_UNIX sockets that are opened to files,
more information about the files can be obtained with the
pstat_getfiledetails()
call. In case of AF_UNIX sockets, the fields
pst_peer_hi_nodeid
and
pst_peer_lo_nodeid
can be used to find the peer socket by matching them with
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, is 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 information about the system. This data may change while the system is run-
ning due to administrative changes in the associated kernel tunables. There is one global
instance of this context. Data, up to a maximum of
elemsize bytes, is returned in the
struct pst_static pointed to by buf. The elemcount 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, is 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 loca-
tion 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 con-
text for each swap area (block or filesystem) configured into the system. For each
instance requested, data, up to a maximum of elemsize bytes, is 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 parameter 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, is 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
narrow 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.
HP-UX 11i Version 2: August 2003 − 9 − Hewlett-Packard Company Section 2−−243