Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/android-openjdk-build-multiarch
Path: blob/buildjre8/patches/jdk8u_android_main.diff
861 views
1
diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp
2
index 2d3880b363..77eb2ac3fd 100644
3
--- a/hotspot/src/os/linux/vm/os_linux.cpp
4
+++ b/hotspot/src/os/linux/vm/os_linux.cpp
5
@@ -93,11 +95,17 @@
6
# include <semaphore.h>
7
# include <fcntl.h>
8
# include <string.h>
9
-# include <syscall.h>
10
# include <sys/sysinfo.h>
11
+#ifndef __ANDROID__
12
# include <gnu/libc-version.h>
13
+#endif
14
# include <sys/ipc.h>
15
+#if !defined(__ANDROID__)
16
+# include <syscall.h>
17
# include <sys/shm.h>
18
+#else
19
+# include <sys/syscall.h>
20
+#endif
21
# include <link.h>
22
# include <stdint.h>
23
# include <inttypes.h>
24
@@ -2977,7 +3048,11 @@ extern "C" JNIEXPORT int fork1() { return fork(); }
25
// Handle request to load libnuma symbol version 1.1 (API v1). If it fails
26
// load symbol from base version instead.
27
void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
28
+#ifndef __ANDROID__
29
void *f = dlvsym(handle, name, "libnuma_1.1");
30
+#else
31
+ void *f = NULL;
32
+#endif
33
if (f == NULL) {
34
f = dlsym(handle, name);
35
}
36
@@ -5867,7 +5978,11 @@ bool os::is_thread_cpu_time_supported() {
37
// Linux doesn't yet have a (official) notion of processor sets,
38
// so just return the system wide load average.
39
int os::loadavg(double loadavg[], int nelem) {
40
+#ifdef __ANDROID__
41
+ return -1;
42
+#else
43
return ::getloadavg(loadavg, nelem);
44
+#endif // !__ANDROID__
45
}
46
47
void os::pause() {
48
49