chiark / gitweb /
Remove <sys/sem.h>
[termux-packages] / disabled-packages / openjdk-9-headless / os_linux.cpp.diff
1 --- ./hotspot-jdk-9+@TAG_VER@/src/os/linux/vm/os_linux.cpp      2017-01-13 05:11:16.000000000 +0530
2 +++ ../os_linux.cpp     2017-02-05 11:25:25.918994081 +0530
3 @@ -98,7 +98,9 @@
4  # include <string.h>
5  # include <syscall.h>
6  # include <sys/sysinfo.h>
7 +# ifndef __ANDROID__
8  # include <gnu/libc-version.h>
9 +# endif
10  # include <sys/ipc.h>
11  # include <sys/shm.h>
12  # include <link.h>
13 @@ -496,6 +498,7 @@
14  // detecting pthread library
15  
16  void os::Linux::libpthread_init() {
17 +#ifndef __ANDROID__
18    // Save glibc and pthread version strings.
19  #if !defined(_CS_GNU_LIBC_VERSION) || \
20      !defined(_CS_GNU_LIBPTHREAD_VERSION)
21 @@ -513,6 +516,10 @@
22    str = (char *)malloc(n, mtInternal);
23    confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
24    os::Linux::set_libpthread_version(str);
25 +#else
26 +  os::Linux::set_glibc_version("bionic 21");
27 +  os::Linux::set_libpthread_version("pthread 21");
28 +#endif
29  }
30  
31  /////////////////////////////////////////////////////////////////////////////
32 @@ -2809,7 +2816,10 @@
33  // If we are running with earlier version, which did not have symbol versions,
34  // we should use the base version.
35  void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
36 -  void *f = dlvsym(handle, name, "libnuma_1.1");
37 +  void *f = NULL;
38 +  #ifndef __ANDROID__
39 +  f = dlvsym(handle, name, "libnuma_1.1");
40 +  #endif
41    if (f == NULL) {
42      f = dlsym(handle, name);
43    }
44 @@ -5471,7 +5481,11 @@
45  // Linux doesn't yet have a (official) notion of processor sets,
46  // so just return the system wide load average.
47  int os::loadavg(double loadavg[], int nelem) {
48 +#ifdef __ANDROID__
49 +  return -1;
50 +#else
51    return ::getloadavg(loadavg, nelem);
52 +#endif
53  }
54  
55  void os::pause() {
56 @@ -6194,7 +6208,15 @@
57    struct stat st;
58    int ret = os::stat(filename, &st);
59    assert(ret == 0, "failed to stat() file '%s': %s", filename, strerror(errno));
60 +#ifdef __ANDROID__
61 +  struct timespec ts;
62 +  unsigned long ms = st.st_mtime;
63 +  ts.tv_sec = ms / 1000;
64 +  ts.tv_nsec = (ms % 1000) * 1000000;
65 +  return ts;
66 +#else
67    return st.st_mtim;
68 +#endif
69  }
70  
71  int os::compare_file_modified_times(const char* file1, const char* file2) {