Index: head/java/openjdk8/files/patch-hotspot-src-os-bsd-vm-os_bsd.cpp =================================================================== --- head/java/openjdk8/files/patch-hotspot-src-os-bsd-vm-os_bsd.cpp (revision 449381) +++ head/java/openjdk8/files/patch-hotspot-src-os-bsd-vm-os_bsd.cpp (revision 449382) @@ -1,26 +1,36 @@ ---- ./hotspot/src/os/bsd/vm/os_bsd.cpp 2016-06-01 20:57:38.276230000 -0500 -+++ ./hotspot/src/os/bsd/vm/os_bsd.cpp 2016-06-01 20:56:46.380667000 -0500 -@@ -767,6 +767,11 @@ +--- hotspot/src/os/bsd/vm/os_bsd.cpp.orig 2017-09-06 22:12:44 UTC ++++ hotspot/src/os/bsd/vm/os_bsd.cpp +@@ -189,7 +189,9 @@ julong os::Bsd::available_memory() { + #ifdef __FreeBSD__ + static const char *vm_stats[] = { + "vm.stats.vm.v_free_count", ++#if __FreeBSD_version < 1200016 + "vm.stats.vm.v_cache_count", ++#endif + "vm.stats.vm.v_inactive_count" + }; + size_t size; +@@ -775,6 +777,11 @@ static void *java_start(Thread *thread) guarantee(unique_thread_id != 0, "unique thread id was not found"); osthread->set_unique_thread_id(unique_thread_id); #endif +#ifdef __FreeBSD__ + uint64_t unique_thread_id = os::Bsd::gettid(); + guarantee(unique_thread_id != 0, "unique thread id was not found"); + osthread->set_unique_thread_id(unique_thread_id); +#endif // initialize signal mask for this thread os::Bsd::hotspot_sigmask(thread); -@@ -930,6 +935,11 @@ +@@ -938,6 +945,11 @@ bool os::create_attached_thread(JavaThre guarantee(unique_thread_id != 0, "just checking"); osthread->set_unique_thread_id(unique_thread_id); #endif +#ifdef __FreeBSD__ + uint64_t unique_thread_id = os::Bsd::gettid(); + guarantee(unique_thread_id != 0, "unique thread id was not found"); + osthread->set_unique_thread_id(unique_thread_id); +#endif osthread->set_pthread_id(::pthread_self()); // initialize floating point control register Index: head/java/openjdk8/files/patch-jdk_src_solaris_native_sun_management_OperatingSystemImpl.c =================================================================== --- head/java/openjdk8/files/patch-jdk_src_solaris_native_sun_management_OperatingSystemImpl.c (revision 449381) +++ head/java/openjdk8/files/patch-jdk_src_solaris_native_sun_management_OperatingSystemImpl.c (revision 449382) @@ -1,14 +1,24 @@ ---- jdk/src/solaris/native/sun/management/OperatingSystemImpl.c.orig 2015-12-10 18:40:39 UTC +--- jdk/src/solaris/native/sun/management/OperatingSystemImpl.c.orig 2017-09-06 22:12:44 UTC +++ jdk/src/solaris/native/sun/management/OperatingSystemImpl.c -@@ -435,11 +435,6 @@ Java_sun_management_OperatingSystemImpl_ +@@ -368,7 +368,9 @@ Java_sun_management_OperatingSystemImpl_ + #elif defined(__FreeBSD__) + static const char *vm_stats[] = { + "vm.stats.vm.v_free_count", ++#if __FreeBSD_version < 1200016 + "vm.stats.vm.v_cache_count", ++#endif + /* "vm.stats.vm.v_inactive_count", */ + NULL + }; +@@ -435,11 +437,6 @@ Java_sun_management_OperatingSystemImpl_ } -#ifdef _ALLBSD_SOURCE -#define FD_DIR "/dev/fd" -#else -#define FD_DIR "/proc/self/fd" -#endif JNIEXPORT jlong JNICALL Java_sun_management_OperatingSystemImpl_getOpenFileDescriptorCount