HP-UX Reference (11i v1 05/09) - 2 System Calls (vol 5)
p
pstat(2) pstat(2)
struct psfileid psr_file;
struct psfileid psr_parent;
char psr_name[PS_SEGMENTNAME_SZ];
psr_idx
is the current index of an entry into the chain of DNLC entries for the filesys-
tem. psr_idx+1 can be passed on to another
pstat_getmpathname()
call as the
index parameter to obtain the entries starting after the last
psr_idx. psr_file is
the file the current entry describes and
psr_parent is the parent of this file.
psr_name is the NULL terminated pathname component for the current entry.
Reverse pathname lookup can be performed by searching the entries for one that has a
psr_file member equal to the psr_parent member of the current entry. This is done
until an entry with a NULL psr_parent entry is located, which indicates that the entry
for the root of the file system has been found. The pathname from the root of the file sys-
tem is formed by concatenating the names given by the
psr_name member of each of the
entries found during the process. If desired, the full pathname can then be formed by con-
catenating the pathname to the mount point of the file system.
Use of this function is limited to UID==0.
On success, the function returns the number of DNLC entries copied. In case of failure, the
value of -1 is returned and
errno is set indicating the cause of the failure.
pstat_getmsg()
Returns information specific to a particular System V message queue. There is one instance
of this context for each System V message queue on the system. For each instance
requested, data, up to a maximum of elemsize bytes, are returned in the structs
pst_msginfo pointed to by buf. The elemcount parameter specifies the number of
structs pst_msginfo that are available at buf to be filled in. The index parameter
specifies the starting index within the context of
System V message queues. As a shortcut,
information for a single message queue may be obtained by setting elemcount to zero
and setting index to the msqid of that message queue.
pstat_getnode()
Returns information specific about a SCA system node. There is one instance of this context
for each SCA node on the system, for each instance requested, up to a maximum of elem-
size
bytes, are returned in the struct pst_node pointed to by buf. The elem-
count
parameter specifies the number of struct pst_node that are available at buf
to be filled in. The index parameter specifies the starting logical node id that is requested.
pstat_getpathname()
Returns 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 vari-
able 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.
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 indicat-
ing the cause of the failure. This call does not work for sockets.
pstat_getproc()
Returns information specific to a particular process. There is one instance of this context
for each active process on the system. For each instance requested, data, up to a maximum
of elemsize bytes, are returned in the structs pst_status pointed to by buf. The
elemcount parameter specifies the number of structs pst_status that are avail-
able at buf to be filled in. The index parameter specifies the starting index within the
context of processes. As a shortcut, information for a single process may be obtained by
setting elemcount to zero and setting index to the PID of that process.
pstat_getprocessor()
Returns information specific to a particular processor (the only processor on a uniprocessor
system). There is one instance of this context for each processor on the system. For each
HP-UX 11i Version 1: September 2005 − 6 − Hewlett-Packard Company Section 2−−243