diff --git a/src/os/hpux/hpux_sigar.c b/src/os/hpux/hpux_sigar.c index 0a149202..b151aed1 100644 --- a/src/os/hpux/hpux_sigar.c +++ b/src/os/hpux/hpux_sigar.c @@ -442,7 +442,39 @@ int sigar_proc_fd_get(sigar_t *sigar, sigar_pid_t pid, int sigar_proc_exe_get(sigar_t *sigar, sigar_pid_t pid, sigar_proc_exe_t *procexe) { - return SIGAR_ENOTIMPL; +#ifdef __pst_fid /* 11.11+ */ + int rc; + struct pst_status status; + + if (pstat_getproc(&status, sizeof(status), 0, pid) == -1) { + return errno; + } + + rc = pstat_getpathname(procexe->cwd, + sizeof(procexe->cwd), + &status.pst_fid_cdir); + if (rc == -1) { + return errno; + } + + rc = pstat_getpathname(procexe->name, + sizeof(procexe->name), + &status.pst_fid_text); + if (rc == -1) { + return errno; + } + + rc = pstat_getpathname(procexe->root, + sizeof(procexe->root), + &status.pst_fid_rdir); + if (rc == -1) { + return errno; + } + + return SIGAR_OK; +#else + return SIGAR_ENOTIMPL; /* 11.00 */ +#endif } int sigar_proc_modules_get(sigar_t *sigar, sigar_pid_t pid,