HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)

p
pstat(2) pstat(2)
rv = pstat_getfile2(&psf, sizeof(psf), 0, fd, target);
if (rv == 1) {
/*
* Ask for multiple path name information.
*/
count = pstat_getmpathname(mpath_buf, sizeof(struct pst_mpathnode),
20, 0, &(psf.psf_id.psf_fsid));
if (count > 0) {
for (i = 0; i < count; i++) {
printf("component %d: %s\n",
i, mpath_buf[i].psr_name);
}
} else if (count == 0) {
printf("path names not found in system cache\n");
} else {
perror("pstat_getmpathname()");
}
} else {
perror("pstat_getfile2");
}
close(fd);
}
Example 14
Acquire the extended command line for the process.
main()
{
char cmdline[1024];
int rv;
(void)memset(&cmdline,0,sizeof(cmdline));
rv = pstat_getcommandline(cmdline, sizeof(cmdline),1, getpid());
if(rv<0){
perror("pstat_getcommandline()");
} else {
printf("Command line : %s \n",cmdline);
}
}
WARNINGS
Some parts of the program status may not get updated when a process becomes a zombie. An example is
the CPU percentage, which is not updated because the process is not expected to be scheduled to run after
entering the zombie state.
AUTHOR
The pstat_get*() routines were developed by HP.
FILES
/usr/include/sys/pstat.h pstat data structures and identifiers
/usr/include/sys/pstat/*_pstat_body.h
pstat data structures and identifiers
Do not use these header files to infer information about the usage of pstat functions that have their own
manpages (see the SYNOPSIS Remarks subsection).
SEE ALSO
pstat_getlocality(2),
HP-UX 11i Version 3: February 2007 25 Hewlett-Packard Company 315