HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)

p
pstat(2) pstat(2)
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
0 and setting index
to the TID (Thread ID) of that LWP within its process.
PSTAT FUNCTION
Name
pstat_getmpathname()
- get entries from system cache of recently looked-up names
Synopsis
#include <sys/pstat.h>
int pstat_getmpathname(
struct pst_mpathnode *
buf,
size_t
elemsize,
size_t
elemcount,
int
index,
struct psfsid *
fid
);
Description
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_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 le system. The elemcount parameter
specifies the number of DNLC entries to be returned. Typically, the index parameter will be specified as
0
and the elemcount parameter will be high enough to obtain all the entries of the specified file system. For
each call, up to a maximum of elemsize bytes of data is returned in the pst_mpathnode
structures
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 file system.
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 path name component for the current entry.
Reverse path name 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 path name from the root of the file system 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 path name can
then be formed by concatenating the path name to the mount point of the file system.
The use of this function is limited to UID 0.
On success, the function returns the number of DNLC entries copied. In case of failure, the value of -1 is
returned and errno is set indicating the cause of the failure.
PSTAT FUNCTION
Name
pstat_getmsg() - get information for a System V message queue
Synopsis
#include <sys/pstat.h>
int pstat_getmsg(
struct pst_msginfo *
buf,
size_t
elemsize,
298 Hewlett-Packard Company 8 HP-UX 11i Version 3: February 2007