HP-UX Reference (11i v1 05/09) - 2 System Calls (vol 5)
p
pstat(2) pstat(2)
RETURN VALUE
Upon successful completion, pstat() and the various wrapper routines (for example,
pstat_getprocessor()
) return the number of instances filled in at the address
buf. Otherwise, a
value of −1 is returned and
errno
is set to indicate the error.
ERRORS
The
pstat functions fail if any of the following conditions are encountered:
[EFAULT]
buf/fid points to an invalid address.
[ESRCH] Process in question is not found or exiting. For the
pstat_getproc()
,
pstat_getprocvm()
, pstat_getlv() , pstat_getsem()
,
pstat_getmsg()
, pstat_getshm()
, pstat_getpset()
calls, elemcount
was 0, specifying the single-item short-cut, and no item matched the selection criteria
in index (for example, PID for pstat_getproc()
).
[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(), pstat_getpset()
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.
Section 2−−246 Hewlett-Packard Company − 9 − HP-UX 11i Version 1: September 2005