aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/openjdk/openjdk-6-6b18-1.8/icedtea-hotspot-loadavg.patch
diff options
context:
space:
mode:
authorHenning Heinold <h.heinold@tarent.de>2010-07-12 13:29:16 +0200
committerHenning Heinold <h.heinold@tarent.de>2010-08-02 10:23:46 +0200
commitb78fc95424b5f0fb28246e8c61bb8b4d6a9d733a (patch)
treef65f5609aabafe474f1f35bb7e284aa733be1081 /recipes/openjdk/openjdk-6-6b18-1.8/icedtea-hotspot-loadavg.patch
parent9e043b45ceba7e65565722c7dc14910547b04d17 (diff)
downloadopenembedded-b78fc95424b5f0fb28246e8c61bb8b4d6a9d733a.tar.gz
openembedded-b78fc95424b5f0fb28246e8c61bb8b4d6a9d733a.tar.bz2
openembedded-b78fc95424b5f0fb28246e8c61bb8b4d6a9d733a.zip
openjdk: backport from openembedded-devstable/2009
Acked-by: Stefan Schmidt <stefan@buglabs.net> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Diffstat (limited to 'recipes/openjdk/openjdk-6-6b18-1.8/icedtea-hotspot-loadavg.patch')
-rw-r--r--recipes/openjdk/openjdk-6-6b18-1.8/icedtea-hotspot-loadavg.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/recipes/openjdk/openjdk-6-6b18-1.8/icedtea-hotspot-loadavg.patch b/recipes/openjdk/openjdk-6-6b18-1.8/icedtea-hotspot-loadavg.patch
new file mode 100644
index 0000000000..7da41fdc08
--- /dev/null
+++ b/recipes/openjdk/openjdk-6-6b18-1.8/icedtea-hotspot-loadavg.patch
@@ -0,0 +1,28 @@
+Index: icedtea6-1.8/build/openjdk/hotspot/src/os/linux/vm/os_linux.cpp
+===================================================================
+--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2010-06-09 22:16:09.406334411 +0200
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2010-06-09 22:19:38.952152043 +0200
+@@ -4325,7 +4325,22 @@
+ // Linux doesn't yet have a (official) notion of processor sets,
+ // so just return the system wide load average.
+ int os::loadavg(double loadavg[], int nelem) {
+- return ::getloadavg(loadavg, nelem);
++
++ FILE *LOADAVG;
++ double avg[3] = { 0.0, 0.0, 0.0 };
++ int i, res = -1;;
++
++ if ((LOADAVG = fopen("/proc/loadavg", "r"))) {
++ fscanf(LOADAVG, "%lf %lf %lf", &avg[0], &avg[1], &avg[2]);
++ res = 0;
++ fclose(LOADAVG);
++ }
++
++ for (i = 0; (i < nelem) && (i < 3); i++) {
++ loadavg[i] = avg[i];
++ }
++
++ return res;
+ }
+
+ void os::pause() {