micro-utils/miscutils/getloadavg.c
2023-10-24 17:45:55 +03:00

14 lines
271 B
C

#include <stdio.h>
#include <stdlib.h>
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]);
}