PSTAT Interfaces

16
int pstat_getnode(struct pst_node *buf, size_t elemsize, size_t elemcount, int index);
Description:
This call returns information about SCA (ccNUMA) system nodes. It is only available as
64-bit data (i.e., _PSTAT64 needs to be defined). There is one instance of this context for each
SCA node on the system. For each instance data up to a maximum of elemsize bytes are returned
in the struct pst_node pointed to by buf. The elemcount parameter specifies the number of struct
pst_node that are available at buf. The index parameter specifies the starting logical node ID that
is requested.
Return Value:
This call returns –1 on failure or number of instances copied to buf on success.
Errors:
EINVAL is set if the user's size declaration isn't valid.
EINVAL is set if the initial selection, index, isn't valid.
EFAULT is set if buf points to invalid address.
4.14 pstat_getpathname()
Synopsis:
int pstat_getpathname(char *buf, size_t elemcount, struct pst_fid *fid);
Description:
This call provides the full pathname of an opened file in buf if it is available in the system
cache of recent names looked up (DNLC). The fid parameter uniquely identifies the opened file.
This fid is obtained from calls to pstat_getfile(), pstat_getfile2(), pstat_getproc(), or
pstat_getprocvm(). The value of elemcount should be at least one greater than the length of the
pathname to be returned. The PATH_MAX variable from pathconf(2) can be used for this
purpose. Use of this function is limited to UID == 0 or effective UID match. Please refer
pstat_getfiledetails() call for more information on Effective UID match. This call does not work
for sockets.
Return Value:
On success, the function returns the length of the pathname copied starting at the location
specified by buf. If the pathname is not available in the system cache, 0 is returned and errno is
not set. On other failures, the value of -1 is returned and errno is set indicating the cause of the
failure.
Errors:
EFAULT is set if buf/fid points to an invalid address.
ENOENT is set if the file is not found, or it is closed.
EINVAL is set if elemcount is less than or equal to zero
EINVAL is set if called for a socket.
EACCESS is set if effective ID does not match.
EOVERFLOW is set if the elemcount parameter is not at lease one greater than the length of
the pathname to be returned.
Example:
#include <sys/pstat.h>
void main(void)
{
struct pst_fileinfo2 psf;
char filename[20];