From a95b8a8b608781ede3b97526724e67615114c35e Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 25 Apr 2009 07:46:40 -0700 Subject: [PATCH] (SIGAR-130) Use pstat(PSTAT_GETCOMMANDLINE,...) on HP-UX < 11iv2 --- src/os/hpux/hpux_sigar.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/os/hpux/hpux_sigar.c b/src/os/hpux/hpux_sigar.c index e0cf4796..d1ffa120 100644 --- a/src/os/hpux/hpux_sigar.c +++ b/src/os/hpux/hpux_sigar.c @@ -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;