micro-utils/coreutils/getloadavg.c
Your Name 7eed71d9b2 mk
2023-10-13 15:34:16 +03:00

16 lines
298 B
C

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