Path: blob/buildjre8/patches/jdk8u_android_main.diff
861 views
diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp1index 2d3880b363..77eb2ac3fd 1006442--- a/hotspot/src/os/linux/vm/os_linux.cpp3+++ b/hotspot/src/os/linux/vm/os_linux.cpp4@@ -93,11 +95,17 @@5# include <semaphore.h>6# include <fcntl.h>7# include <string.h>8-# include <syscall.h>9# include <sys/sysinfo.h>10+#ifndef __ANDROID__11# include <gnu/libc-version.h>12+#endif13# include <sys/ipc.h>14+#if !defined(__ANDROID__)15+# include <syscall.h>16# include <sys/shm.h>17+#else18+# include <sys/syscall.h>19+#endif20# include <link.h>21# include <stdint.h>22# include <inttypes.h>23@@ -2977,7 +3048,11 @@ extern "C" JNIEXPORT int fork1() { return fork(); }24// Handle request to load libnuma symbol version 1.1 (API v1). If it fails25// load symbol from base version instead.26void* os::Linux::libnuma_dlsym(void* handle, const char *name) {27+#ifndef __ANDROID__28void *f = dlvsym(handle, name, "libnuma_1.1");29+#else30+ void *f = NULL;31+#endif32if (f == NULL) {33f = dlsym(handle, name);34}35@@ -5867,7 +5978,11 @@ bool os::is_thread_cpu_time_supported() {36// Linux doesn't yet have a (official) notion of processor sets,37// so just return the system wide load average.38int os::loadavg(double loadavg[], int nelem) {39+#ifdef __ANDROID__40+ return -1;41+#else42return ::getloadavg(loadavg, nelem);43+#endif // !__ANDROID__44}4546void os::pause() {474849