HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
p
pstat(2) pstat(2)
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 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.
RETURN VALUE
Upon successful completion, pstat() and the various wrapper routines (for example,
pstat_getprocessor()
) return the number of instances filled in at the address buf. Otherwise, a
value of 1 is returned and
errno is set to indicate the error.
ERRORS
The pstat functions fail if any of the following conditions are encountered:
[EFAULT] buf/fid points to an invalid address.
[ESRCH] Process in question is not found or exiting. For the pstat_getproc(),
pstat_getprocvm(), pstat_getlv() , pstat_getsem()
,
pstat_getmsg(), pstat_getshm() calls, elemcount was 0, specifying the
single-item short-cut, and no item matched the selection criteria in index (for exam-
ple, PID for pstat_getproc()
).
HP-UX Release 11i: December 2000 8 Section 2225
___
___