HP-UX Reference (11i v2 07/12) - 2 System Calls (vol 5)
p
pstat(2) pstat(2)
context. This data may change while the system is running due to administrative changes
in the associated kernel tunables. Data, up to a maximum of
elemsize bytes, is returned
in the
struct pst_ipcinfo pointed to by buf
. The elemcount parameter must be
1. The
index parameter must be 0.
pstat_getlocality()
Returns information specific to a particular locality. See the pstat_getlocality(2) manpage.
pstat_getlv()
Returns information specific to a particular logical volume. There is one instance of this
context for each logical volume configured into the system. For each instance requested,
data, up to a maximum of elemsize bytes, is returned in the
structs pst_lvinfo
pointed to by buf. The elemcount parameter specifies the number of
structs
pst_lvinfo that are available at buf to be filled in. The
index parameter specifies
the starting index within the context of logical volumes. As a shortcut, information for a
single logical volume may be obtained by setting
elemcount to zero and setting index
to the dev_t of that logical volume.
pstat_getlwp()
Returns information specific to a particular thread or LWP (Lightweight Process) in a pro-
cess. There is one instance of this context for each LWP in a process on the system. For
each instance requested, data, up to a maximum of
elemsize bytes, is returned in the
struct lwp_status pointed to by buf. The elemcount parameter specifies the
number of struct lwp_status that are available at buf to be filled in. The index
parameter specifies the starting index within the context of LWPs in a process.
If pid is set to -1 and elemcount is greater than 0, elemcount entries of system
LWP information are returned to the caller program.
If pid is greater than or equal to 0 and elemcount is greater than 0, elemcount
entries of LWP info within the process specified by pid are returned.
As a shortcut, information about a single LWP can be obtained by setting
elemcount to
zero and setting
index to the TID (Thread ID) of that LWP within its process.
pstat_getmpathname()
Returns the entries from the system cache of recent names looked up (DNLC) for a
specified file system, in
buf. The fsid parameter uniquely identifies the file system. This
fsid should be the psf_fsid field of a psfileid structure obtained from calls to
pstat_getfile(), pstat_getfile2()
, pstat_getproc(),or
pstat_getprocvm()
. The index parameter specifies the starting entry within the
chain of DNLC entries to be returned for the specified filesystem. The
elemcount
param-
eter specifies the number of DNLC entries to be returned. Typically, the
index parameter
will be specified as zero and the
elemcount parameter will be high enough to obtain all
the entries of the specified file system. For each call, data, up to a maximum of
elem-
size
bytes, is returned in the structs pst_mpathnode
pointed to by buf. The
pst_mpathnode structure contains the following members:
_T_ULONG_T psr_idx;
struct psfileid psr_file;
struct psfileid psr_parent;
char psr_name[PS_SEGMENTNAME_SZ];
psr_idx
is the current index of an entry into the chain of DNLC entries for the filesys-
tem. psr_idx+1 can be passed on to another pstat_getmpathname() call as the
index parameter to obtain the entries starting after the last psr_idx. psr_file is
the file the current entry describes and psr_parent is the parent of this file.
psr_name is the NULL terminated pathname component for the current entry.
Reverse pathname lookup can be performed by searching the entries for one that has a
psr_file member equal to the psr_parent member of the current entry. This is done
until an entry with a NULL psr_parent entry is located, which indicates that the entry
for the root of the file system has been found. The pathname from the root of the file sys-
tem is formed by concatenating the names given by the psr_name member of each of the
entries found during the process. If desired, the full pathname can then be formed by con-
catenating the pathname to the mount point of the file system.
HP-UX 11i Version 2: December 2007 Update − 6 − Hewlett-Packard Company 279