hotspot/src/share/vm/runtime/os.cpp
changeset 10565 dc90c239f4ec
parent 10278 e656a9aae10d
child 10739 91935236600e
equal deleted inserted replaced
10564:db5bf5438c0a 10565:dc90c239f4ec
    58 #endif
    58 #endif
    59 #ifdef TARGET_OS_FAMILY_windows
    59 #ifdef TARGET_OS_FAMILY_windows
    60 # include "os_windows.inline.hpp"
    60 # include "os_windows.inline.hpp"
    61 # include "thread_windows.inline.hpp"
    61 # include "thread_windows.inline.hpp"
    62 #endif
    62 #endif
       
    63 #ifdef TARGET_OS_FAMILY_bsd
       
    64 # include "os_bsd.inline.hpp"
       
    65 # include "thread_bsd.inline.hpp"
       
    66 #endif
    63 
    67 
    64 # include <signal.h>
    68 # include <signal.h>
    65 
    69 
    66 OSThread*         os::_starting_thread    = NULL;
    70 OSThread*         os::_starting_thread    = NULL;
    67 address           os::_polling_page       = NULL;
    71 address           os::_polling_page       = NULL;
   114   struct tm time_struct;
   118   struct tm time_struct;
   115   if (localtime_pd(&seconds_since_19700101, &time_struct) == NULL) {
   119   if (localtime_pd(&seconds_since_19700101, &time_struct) == NULL) {
   116     assert(false, "Failed localtime_pd");
   120     assert(false, "Failed localtime_pd");
   117     return NULL;
   121     return NULL;
   118   }
   122   }
       
   123 #if defined(_ALLBSD_SOURCE)
       
   124   const time_t zone = (time_t) time_struct.tm_gmtoff;
       
   125 #else
   119   const time_t zone = timezone;
   126   const time_t zone = timezone;
       
   127 #endif
   120 
   128 
   121   // If daylight savings time is in effect,
   129   // If daylight savings time is in effect,
   122   // we are 1 hour East of our time zone
   130   // we are 1 hour East of our time zone
   123   const time_t seconds_per_minute = 60;
   131   const time_t seconds_per_minute = 60;
   124   const time_t minutes_per_hour = 60;
   132   const time_t minutes_per_hour = 60;
   382     dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), "java");
   390     dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), "java");
   383     _native_java_library = dll_load(buffer, ebuf, sizeof(ebuf));
   391     _native_java_library = dll_load(buffer, ebuf, sizeof(ebuf));
   384     if (_native_java_library == NULL) {
   392     if (_native_java_library == NULL) {
   385       vm_exit_during_initialization("Unable to load native library", ebuf);
   393       vm_exit_during_initialization("Unable to load native library", ebuf);
   386     }
   394     }
       
   395 
       
   396 #if defined(__OpenBSD__)
       
   397     // Work-around OpenBSD's lack of $ORIGIN support by pre-loading libnet.so
       
   398     // ignore errors
       
   399     dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), "net");
       
   400     dll_load(buffer, ebuf, sizeof(ebuf));
       
   401 #endif
   387   }
   402   }
   388   static jboolean onLoaded = JNI_FALSE;
   403   static jboolean onLoaded = JNI_FALSE;
   389   if (onLoaded) {
   404   if (onLoaded) {
   390     // We may have to wait to fire OnLoad until TLS is initialized.
   405     // We may have to wait to fire OnLoad until TLS is initialized.
   391     if (ThreadLocalStorage::is_initialized()) {
   406     if (ThreadLocalStorage::is_initialized()) {