In HPUX 11.31 this works:
#include <sys/pstat.h>
char* tmp = (char*)malloc(256);
pstat_getcommandline(tmp, sizeof(char)*256, (size_t)1, (int)pid)
But on HPUX 11.11 pstat_getcommandline isn't defined in /usr/include/sys/pstat.h. I've tried calling pstat() directly (passing in PSTAT_GETCOMMANDLINE as the first parameter, which does happen to be defined in /usr/include/sys/pstat/pstat_ops.h on 11.11), but this fails. I noticed that pst_command_name is not defined in the pstun union in /usr/include/sys/pstat.h on 11.11.
Is there some alternative method for getting the command line on HPUX 11.11?