--- projects/libstatgrab/src/libstatgrab/tools.c 2004/11/01 20:34:58 1.58 +++ projects/libstatgrab/src/libstatgrab/tools.c 2004/11/06 14:55:53 1.59 @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA * - * $Id: tools.c,v 1.58 2004/11/01 20:34:58 ats Exp $ + * $Id: tools.c,v 1.59 2004/11/06 14:55:53 ats Exp $ */ #ifdef HAVE_CONFIG_H @@ -42,6 +42,10 @@ #include #include #endif +#ifdef HPUX +#include +#include +#endif #include "tools.h" #include "statgrab.h" @@ -486,6 +490,23 @@ struct uvmexp *sg_get_uvmexp() { } return &uvm; +} +#endif + +#ifdef HPUX +struct pst_static *sg_get_pstat_static() { + static int got = 0; + static struct pst_static pst; + + if (!got) { + if (pstat_getstatic(&pst, sizeof pst, 1, 0) == -1) { + sg_set_error_with_errno(SG_ERROR_PSTAT, + "pstat_static"); + return NULL; + } + got = 1; + } + return &pst; } #endif