HP-UX Reference (11i v1 05/09) - 2 System Calls (vol 5)
p
pstat(2) pstat(2)
pstat_getcrashinfo()
Returns information about the system’s crash dump configuration. Data, up to a maximum
of elemsize bytes, are returned in the struct pst_crashinfo
pointed to by
buf.
The
elemcount parameter must be 1. The index
parameter must be 0.
pstat_getdisk()
Returns information specific to a particular disk. There is one instance of this context for
each disk configured into the system. For each instance requested, data, up to a maximum
of
elemsize bytes, are returned in the
structs pst_diskinfo pointed to by buf.
The
elemcount parameter specifies the number of
structs pst_diskinfo that are
available at
buf to be filled in. The
index parameter specifies the starting index within
the context of disks.
pstat_getdynamic()
Returns dynamic information about the system. There is one global instance of this con-
text. Data, up to a maximum of
elemsize
bytes, are returned in the struct
pst_dynamic
pointed to by buf. The elemcount
parameter must be 1. The index
parameter must be 0.
pstat_getfile()
This call is now obsolete and is provided for backward compatibility only. Use of
pstat_getfile2() call is recommended. Returns information specific to a particular
open file for a specified process. For the specified process, there is one instance of this con-
text for each open file descriptor. For each instance requested, data, up to a maximum of
elemsize bytes, are returned in the structs pst_fileinfo pointed to by buf. The
elemcount parameter specifies the number of structs pst_fileinfo that are
available at buf to be filled in. The index parameter specifies the starting index within
the context of open files for the specified process: it is a 32-bit quantity constructed of the
pst_idx field of the ’owning’ process, obtained via pstat_getproc()
, described
above, as the most significant 16 bits, and the index of open files within the process as the
least significant 16 bits. Example:
index = ((pst_idx << 16) | (file_index & 0xffff)); As a shortcut,
information for a single file within the specified process may be obtained by setting
elem-
count
to zero and setting the least significant 16 bits to the file descriptor number (the
most significant 16 bits are still set to the pst_idx field from the pst_status
struc-
ture for the process).
The
pst_fileinfo structure contains both a psf_offset and psf_offset64 ele-
ment. The psf_offset element can correctly store a 32-bit value, whereas the
psf_offset64 element can store a 64-bit value. pstat_getfile()
will fill in both
psf_offset and psf_offset64 if the value can be correctly stored in both elements.
If the offset is too large to be correctly stored in psf_offset , then
psf_offset will
contain a -1. No error will be set in this case.
pstat_getfile2()
Returns information specific to a particular open file for a specified process. For the
specified process, there is one instance of this context for each open file descriptor. For
each instance requested, data, up to a maximum of
elemsize bytes, are returned in the
structs pst_fileinfo2 pointed to by buf. The elemcount parameter specifies
the number of structs pst_fileinfo2 that are available at buf to be filled in. The
index parameter specifies the starting index within the context of open files for the
specified process: It is the file descriptor number with which to begin. The pid parameter
specifies the process ID.
As a shortcut, information for a single file within the specified process may be obtained by
setting elemcount to zero and setting the index to the file descriptor number.
The pst_fileinfo2 structure contains both a psf_offset and psf_offset64
element. The psf_offset element can correctly store a 32-bit value, whereas the
psf_offset64 element can store a 64-bit value. pstat_getfile2() will fill in both
psf_offset and psf_offset64 if the value can be correctly stored in both elements.
If the offset is too large to be correctly stored in psf_offset , then psf_offset will
contain a -1. No error will be set in this case.
pstat_getfiledetails()
Returns detailed information specific to a particular open file. For a specified opened file,
HP-UX 11i Version 1: September 2005 − 4 − Hewlett-Packard Company Section 2−−241