#ifdef HPUX
#include <sys/pstat.h>
int getloadavg(double loadavg[], int nelem)
{
	int elem = 0;
	struct pst_dynamic dyn_info;

	if (pstat_getdynamic (&dyn_info, sizeof (dyn_info), 0, 0) < 0)
		return -1;

	if (nelem > 0)
		loadavg[elem++] = dyn_info.psd_avg_1_min;
	if (nelem > 1)
		loadavg[elem++] = dyn_info.psd_avg_5_min;
	if (nelem > 2)
		loadavg[elem++] = dyn_info.psd_avg_15_min;
	return(nelem < 3 ? nelem : 3);
}
#endif

