HP-UX Reference (11i v1 05/09) - 2 System Calls (vol 5)

p
pstat(2) pstat(2)
there is only one instance of this context. For each call, data up to a maximum of
elem-
size
bytes are returned in the struct pst_filedetails
pointed to by
buf. The
fid parameter uniquely identifies the file. This
fid is obtained from calls to
pstat_getfile()
, pstat_getproc()
,orpstat_getprocvm()
. The
pst_filedetails
structure contains information equivalent to the stat(2) call. Use of
this function is limited to UID==0 or effective UID match. Effective UID match occurs
when the effective or real UID of the calling thread matches the effective or real UID of the
target process and the target process has NOT done a set[u/g]id.
The structure members
psfd_mode, psfd_ino,
psfd_dev, psfd_uid, psfd_gid,
psfd_atime , psfd_mtime, and psfd_ctime will have meaningful values for regular
files, character or block special files, and pipes. The value of the member
psfd_nlink
will be set to number of links to the file. The member
psfd_rdev will have meaningful
value for character or block special files, while the
psfd_size is valid for regular files.
The members
psfd_hi_fileid
, psfd_lo_fileid
, psfd_hi_nodeid
, and
psfd_lo_nodeid
are unique ids representing the opened file. These ids together are
used to match the corresponding ids returned from the
pstat_getfile2()
. This call
does not work for sockets other than AF_UNIX family type.
pstat_getipc()
Returns information about System V IPC subsystem. There is one global instance of this
context. This data does not vary while the system is running. Data, up to a maximum of
elemsize bytes, are returned in the struct pst_ipcinfo pointed to by buf. The
elemcount parameter must be 1. The index parameter must be 0.
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, are 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, are 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 elemsize
bytes are returned in the structs pst_mpathnode pointed to by buf. The
pst_mpathnode structure contains the following members:
_T_ULONG_T psr_idx;
Section 2242 Hewlett-Packard Company 5 HP-UX 11i Version 1: September 2005