micro-utils/miscutils/getloadavg.c
Your Name c53f033022 .
2023-10-23 12:31:39 +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]);
}