blob: ccc4c388edaeb3436e9ef4d96282c81f393d80be (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
--- a/lib/misc/hostinfoPosix.c
+++ b/lib/misc/hostinfoPosix.c
@@ -1398,7 +1398,15 @@
float *avg1, // IN/OUT:
float *avg2) // IN/OUT:
{
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__UCLIBC__)
+ FILE *f;
+ if ((f = fopen("/proc/loadavg", "r")) == NULL)
+ return FALSE;
+ fscanf(f, "%f %f %f", avg0, avg1, avg2);
+ fclose(f);
+ return TRUE;
+
+#elif defined(GLIBC_VERSION_22) || defined(__APPLE__)
double avg[3];
int res;
|