pstat.2 (2010 09)

p
pstat(2) pstat(2)
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),
iostat(1), ps(1), top(1), vmstat(1), coreadm(1M), crashconf(1M), fuser(1M), vgdisplay(1M), coreadm(2),
crashconf(2), errno(2), mq_open(2), msgctl(2), sem_open(2), semctl(2), shmctl(2), stat(2), sysconf(2),
fileno(3S), privileges(5), thread_safety(5).
HP-UX 11i Version 3: September 2010 27 Hewlett-Packard Company 27