(SIGAR-130) Use pstat(PSTAT_GETCOMMANDLINE,...) on HP-UX < 11iv2
This commit is contained in:
parent
8e6a2179dd
commit
a95b8a8b60
|
@ -387,9 +387,19 @@ int sigar_os_proc_args_get(sigar_t *sigar, sigar_pid_t pid,
|
|||
#ifdef PSTAT_GETCOMMANDLINE
|
||||
char buf[1024]; /* kernel limit */
|
||||
|
||||
# ifdef pstat_getcommandline /* 11i v2 + */
|
||||
if (pstat_getcommandline(buf, sizeof(buf), sizeof(buf[0]), pid) == -1) {
|
||||
return errno;
|
||||
}
|
||||
# else
|
||||
union pstun pu;
|
||||
|
||||
pu.pst_command = buf;
|
||||
if (pstat(PSTAT_GETCOMMANDLINE, pu, sizeof(buf), sizeof(buf[0]), pid) == -1) {
|
||||
return errno;
|
||||
}
|
||||
# endif /* pstat_getcommandline */
|
||||
|
||||
args = buf;
|
||||
#else
|
||||
struct pst_status status;
|
||||
|
|
Loading…
Reference in New Issue