< prev index next >

src/hotspot/share/runtime/os.cpp

Print this page
rev 56072 : 8230043: Lazily load libverify
Reviewed-by: hseigel, erikj, alanb


 525 
 526 
 527 void os::terminate_signal_thread() {
 528   if (!ReduceSignalUsage)
 529     signal_notify(sigexitnum_pd());
 530 }
 531 
 532 
 533 // --------------------- loading libraries ---------------------
 534 
 535 typedef jint (JNICALL *JNI_OnLoad_t)(JavaVM *, void *);
 536 extern struct JavaVM_ main_vm;
 537 
 538 static void* _native_java_library = NULL;
 539 
 540 void* os::native_java_library() {
 541   if (_native_java_library == NULL) {
 542     char buffer[JVM_MAXPATHLEN];
 543     char ebuf[1024];
 544 
 545     // Try to load verify dll first. In 1.3 java dll depends on it and is not
 546     // always able to find it when the loading executable is outside the JDK.
 547     // In order to keep working with 1.2 we ignore any loading errors.
 548     if (dll_locate_lib(buffer, sizeof(buffer), Arguments::get_dll_dir(),
 549                        "verify")) {
 550       dll_load(buffer, ebuf, sizeof(ebuf));
 551     }
 552 
 553     // Load java dll
 554     if (dll_locate_lib(buffer, sizeof(buffer), Arguments::get_dll_dir(),
 555                        "java")) {
 556       _native_java_library = dll_load(buffer, ebuf, sizeof(ebuf));
 557     }
 558     if (_native_java_library == NULL) {
 559       vm_exit_during_initialization("Unable to load native library", ebuf);
 560     }
 561 
 562 #if defined(__OpenBSD__)
 563     // Work-around OpenBSD's lack of $ORIGIN support by pre-loading libnet.so
 564     // ignore errors
 565     if (dll_locate_lib(buffer, sizeof(buffer), Arguments::get_dll_dir(),
 566                        "net")) {
 567       dll_load(buffer, ebuf, sizeof(ebuf));
 568     }
 569 #endif
 570   }
 571   return _native_java_library;
 572 }




 525 
 526 
 527 void os::terminate_signal_thread() {
 528   if (!ReduceSignalUsage)
 529     signal_notify(sigexitnum_pd());
 530 }
 531 
 532 
 533 // --------------------- loading libraries ---------------------
 534 
 535 typedef jint (JNICALL *JNI_OnLoad_t)(JavaVM *, void *);
 536 extern struct JavaVM_ main_vm;
 537 
 538 static void* _native_java_library = NULL;
 539 
 540 void* os::native_java_library() {
 541   if (_native_java_library == NULL) {
 542     char buffer[JVM_MAXPATHLEN];
 543     char ebuf[1024];
 544 








 545     // Load java dll
 546     if (dll_locate_lib(buffer, sizeof(buffer), Arguments::get_dll_dir(),
 547                        "java")) {
 548       _native_java_library = dll_load(buffer, ebuf, sizeof(ebuf));
 549     }
 550     if (_native_java_library == NULL) {
 551       vm_exit_during_initialization("Unable to load native library", ebuf);
 552     }
 553 
 554 #if defined(__OpenBSD__)
 555     // Work-around OpenBSD's lack of $ORIGIN support by pre-loading libnet.so
 556     // ignore errors
 557     if (dll_locate_lib(buffer, sizeof(buffer), Arguments::get_dll_dir(),
 558                        "net")) {
 559       dll_load(buffer, ebuf, sizeof(ebuf));
 560     }
 561 #endif
 562   }
 563   return _native_java_library;
 564 }


< prev index next >