#include #include int main(void) { double avg[3] = {0, 0, 0}; if (getloadavg(avg, sizeof(avg) / sizeof(avg[0])) < 0) { fprintf(stderr, "getloadavg: getloadavg() failed\n"); return 1; } printf("%.2f %.2f %.2f\n", avg[0], avg[1], avg[2]); }