--- maybe, some day - add supports to e.g. HP-UX et.al.


/*
 * From: Daniel Hannigan <daniel@hparc.eurocontrol.fr>
 *
 * The will only work on HPUX > 9.0
 */

#include <sys/pstat.h>

getloadavg (ave, na)
double *ave;
int na;
{
        struct pst_dynamic pstd;
        int i;

        if (pstat_getdynamic (&pstd, sizeof (struct pst_dynamic), 0, 0)) {
                for (i=0; i< na; ++i)
                        *(ave + i) = 0.0;
                return (-1);
        }

        switch (na) {
                case 3:
                        *(ave + 2) = pstd.psd_avg_15_min;
                case 2:
                        *(ave + 1) = pstd.psd_avg_5_min;
                case 1:
                        *(ave) = pstd.psd_avg_1_min;
                default:
                        break;
        }
        return (0);
}


