PSTAT Interfaces

31
_T_OFF64_T _PSF_OFFSET64; /*
* Current 64-bit offset in the file
* If __STDC_32_MODE__, defined as
* off32_t psf_dummy[2];
*/
This structure provides three types of identifiers, namely: psf_id, psf_fid, and fileid and
nodeid. This section explains the usage of these ids. The pstat_getfile2() call returns a list of all
open files for a process. The pstat_getproc() call provides the text file, current working directory
(cwd), and root. The pstat_getprocvm() call provides the memory regions for the process. If
more information is needed for an opened file, a second set of calls, namely:
pstat_getfiledetails(), pstat_getsocket(), or pstat_getstream(), or pstat_getpathname(), can be
used.
The members hi_fileid, lo_fileid, hi_nodeid, lo_nodeid fields are returned by both sets of
calls (with exception of pstat_getpathname()). The user should compare the ids returned from
both calls to make sure that the state of the system has not changed. That is, between the
pstat_getfile2() call and pstat_getfiledetails() call, the opened file may have been closed. It is
possible that the same file descriptor is reassigned to some other file. But fileid and nodeid fields
would be different. This detects the state change.
The psf_fid is returned only by the first set of calls, that is pstat_getfile2(),
pstat_getproc() and pstat_getprocvm(). psf_fid is a unique ID that is used by kernel to easily
access the opened file. Its contents are opaque to the user; they are for kernel use only. The user
need only pass the pst_fid back to kernel in the second set of calls so that kernel can efficiently
and effectively reaccess the file in question.
The psfsid is returned with every file, cwd, memory regions, and root. This contains the
file system identification and inode numbers. This needs to be passed to pstat_getmpathname()
call to get all the DNLC entries for that file system.
__psfileid
This structure is an abstraction of a unique identification for an opened file. Header file:
<sys/pstat/pstat_body.h>
struct __psfsid psf_fsid; /* Filesystem identification */
_T_LONG_T psf_fileid; /* File identification within FS */
_T_LONG_T psf_spare; /* Reserved for future expansion */
__psfsid
This strucutre is an abstraction of a unique identification for a file system. Header file:
<sys/pstat/pstat_body.h>
_T_LONG_T psfs_id; /* Filesystem ID */
_T_LONG_T psfs_type; /* Filesystem type */
pst_filedetails
Header file: <sys/pstat/filedetails_pstat_body.h>
uint32_t psfd_hi_fileid; /* Per shared file ID. See above. */
uint32_t psfd_lo_fileid;
uint32_t psfd_hi_nodeid; /* Per vnode ID. See above. */
uint32_t psfd_lo_nodeid;