HP-UX 11i June 2004 Release Notes

Programming
Miscellaneous
Chapter 15
318
NOTE This release includes an enhanced version of pstat(). This version repairs some
existing defects by adding more fields in pst_status struct to return process children
usage information. The pstat (2) manpage reflects this added functionality. The
enhancement poses no problem for 11.0 executables running on 11.0 Extension Pack or
11i, nor for any executables running on 11.0 Extension Pack, as long as they do not rely
on the additional functionality.
Note, however, relocatable objects may incorrectly presume that the size of returned
information is the same pre- and post-patch. It is possible to determine the size of
information returned. pstat() users can use the size return value of the system call to
maintain relocatable object compatibility and portability across the proposed change.
This is documented in the manpage.
pstat() is not part of an industry standard, but was designed to accommodate changes
of this nature while maintaining compatibility with earlier versions.
New Modules
The following table shows new pstat modules and the purpose of each:
NOTE Use of the call pstat_getmpathname() is limited to uid equal to 0. Use of the calls
pstat_getfiledetails(), pstat_getsocket(), pstat_getstream(), and
pstat_getpathanme() is limited to uid equal to 0 or effective ID match. In the case of
effective ID match, access will only be granted if the target process is not and has never
run as a setuid or setgid process.
New Data Structures
The following are new data structures being added to the PSTAT module:
pstat_getfile2() Provides information about open files of a process
pstat_getfiledetails() Provides stat equivalent information
pstat_getsocket() Provides detailed socket information
pstat_getstream() Provides detailed stream information
pstat_getpathname() Provides full pathname of an opened file (Reverse
Pathname Lookup)
pstat_getmpathname() Provides a copy of the DNLC entries for a given file
system
pst_fileinfo2 Describes per-file information. For the specified process, there
is one instance of this context for each open file descriptor.