HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
p
pstat(2) pstat(2)
[ENOENT] For calls pstat_getfile(), pstat_getfile2(),
pstat_getfiledetails(), pstat_getsocket(), pstat_getstream(),
pstat_getpathname() ENOENT is returned if the file is not found, or it is
closed. For pstat_getmpathname() call, ENOENT is returned if the specified
file system is not found or if the file system does not have DNLC entries.
[EINVAL] For the pstat_getproc(), pstat_getprocvm(), pstat_getlv(),
pstat_getsem(), pstat_getmsg(), pstat_getshm()
pstat_getfile()
or pstat_getfile2() calls, elemcount was not zero,
and index was less than zero.
[EINVAL] elemsize is less than or equal to zero or elemsize is larger than the size of the
associated data structure (for example, elemsize>sizeof( struct
pst_processor
) for the pstat_getprocessor() call).
[EINVAL] elemcount is not 1 or index is not zero for the pstat_getstatic(),
pstat_getdynamic(), pstat_getvminfo(), pstat_getipc(),
pstat_getstable(),orpstat_getcrashinfo() calls.
[EINVAL] elemcount
is not greater than or equal to 1 or index is not greater than or equal
to zero for the
pstat_getprocessor()
,
pstat_getdisk(),
pstat_getswap()
, pstat_getcrashdev()
,orpstat_getnode()
calls.
[EINVAL]
index is not a valid logical node id for
pstat_getnode() call.
[EINVAL]
elemcount is less than or equal to zero for pstat_getpathname()
call.
[EINVAL] If
pstat_getfiledetails()
is called for a socket other than AF_UNIX family
or
pstat_getpathname
is called for a socket
[EINVAL] If
pstat_getsocket()
is called for a file which is not of type socket
[EACCES] If uid!=0 or effective id does not match for calls
pstat_getfiledetails(),
pstat_getsocket()
, pstat_getstream(), and pstat_getpathname()
.
[EOVERFLOW]
Offset element is too large to store into the structure pointed to by the
buf argument.
[EOVERFLOW]
For the
pstat_getfiledetails()
call, a value to be stored would overflow one
of the members of the
pst_filedetails
structure. The psfd_valid member
indicates the field that overflowed.
[EOVERFLOW]
For the
pstat_getpathname()
call, the elemcount parameter is not one
greater than the length of the pathname to be returned.
[ENOSTR]
pstat_getstream() is called for a file which is neither a stream nor a stream
based pipe/socket.
[EINTR] For pstat_getsocket() call, the operation was terminated due to the receipt of
a signal, and no data was transferred.
[ENOBUFS] For pstat_getsocket()
call, the operation was terminated due to unavailability
of buffer space.
BACKWARD COMPATIBILITY
The specific calling convention of passing the expected data structure size is used in order to allow for
future expansion of the interface, while preserving backwards source and object compatibility for programs
written using the pstat interfaces. Three rules are followed to allow existing applications to continue to
execute from release to release of the operating system.
New data for a context are added to the end of that context’s data structure.
Old, obsolete data members are
NOT deleted from the data structure.
The operating system honors the elemsize parameter of the call and only returns the first
elemsize bytes of the context data, even if the actual data structure has since been enlarged.
In this way, an application which passes its compile-time size of the context’s data structure (for example,
sizeof(struct pst_processor
) for the per-process context) as the elemsize parameter will
continue to execute on future operating system releases without recompilation, even those that have larger
Section 2226 9 HP-UX Release 11i: December 2000
___
___