aboutsummaryrefslogtreecommitdiffstats
path: root/testing/open-vm-tools/getloadavg-uclibc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/open-vm-tools/getloadavg-uclibc.patch')
-rw-r--r--testing/open-vm-tools/getloadavg-uclibc.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/testing/open-vm-tools/getloadavg-uclibc.patch b/testing/open-vm-tools/getloadavg-uclibc.patch
new file mode 100644
index 0000000000..247bd70374
--- /dev/null
+++ b/testing/open-vm-tools/getloadavg-uclibc.patch
@@ -0,0 +1,22 @@
+diff --git a/lib/misc/hostinfoPosix.c b/lib/misc/hostinfoPosix.c
+index eeeb620..67387be 100644
+--- a/lib/misc/hostinfoPosix.c
++++ b/lib/misc/hostinfoPosix.c
+@@ -1355,8 +1355,16 @@ HostinfoGetLoadAverage(float *avg0, // IN/OUT:
+ float *avg1, // IN/OUT:
+ float *avg2) // IN/OUT:
+ {
++#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;
++
+ /* getloadavg(3) was introduced with glibc 2.2 */
+-#if defined(GLIBC_VERSION_22) || defined(__APPLE__)
++#elif defined(GLIBC_VERSION_22) || defined(__APPLE__)
+ double avg[3];
+ int res;
+