< prev index next >

src/java.base/unix/native/libjli/java_md_solinux.c

Print this page

610         dlsym(libjvm, "JNI_CreateJavaVM");
611     if (ifn->CreateJavaVM == NULL) {
612         JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
613         return JNI_FALSE;
614     }
615 
616     ifn->GetDefaultJavaVMInitArgs = (GetDefaultJavaVMInitArgs_t)
617         dlsym(libjvm, "JNI_GetDefaultJavaVMInitArgs");
618     if (ifn->GetDefaultJavaVMInitArgs == NULL) {
619         JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
620         return JNI_FALSE;
621     }
622 
623     ifn->GetCreatedJavaVMs = (GetCreatedJavaVMs_t)
624         dlsym(libjvm, "JNI_GetCreatedJavaVMs");
625     if (ifn->GetCreatedJavaVMs == NULL) {
626         JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
627         return JNI_FALSE;
628     }
629 









630     return JNI_TRUE;
631 }
632 
633 /*
634  * Compute the name of the executable
635  *
636  * In order to re-exec securely we need the absolute path of the
637  * executable. On Solaris getexecname(3c) may not return an absolute
638  * path so we use dladdr to get the filename of the executable and
639  * then use realpath to derive an absolute path. From Solaris 9
640  * onwards the filename returned in DL_info structure from dladdr is
641  * an absolute pathname so technically realpath isn't required.
642  * On Linux we read the executable name from /proc/self/exe.
643  * As a fallback, and for platforms other than Solaris and Linux,
644  * we use FindExecName to compute the executable name.
645  */
646 const char*
647 SetExecname(char **argv)
648 {
649     char* exec_path = NULL;

610         dlsym(libjvm, "JNI_CreateJavaVM");
611     if (ifn->CreateJavaVM == NULL) {
612         JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
613         return JNI_FALSE;
614     }
615 
616     ifn->GetDefaultJavaVMInitArgs = (GetDefaultJavaVMInitArgs_t)
617         dlsym(libjvm, "JNI_GetDefaultJavaVMInitArgs");
618     if (ifn->GetDefaultJavaVMInitArgs == NULL) {
619         JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
620         return JNI_FALSE;
621     }
622 
623     ifn->GetCreatedJavaVMs = (GetCreatedJavaVMs_t)
624         dlsym(libjvm, "JNI_GetCreatedJavaVMs");
625     if (ifn->GetCreatedJavaVMs == NULL) {
626         JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
627         return JNI_FALSE;
628     }
629 
630 #ifdef INCLUDE_TSAN
631     ifn->TsanSymbolize = (TsanSymbolize_t)
632         dlsym(libjvm, "TsanSymbolize");
633     if (ifn->TsanSymbolize == NULL) {
634         JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
635         return JNI_FALSE;
636     }
637 #endif
638 
639     return JNI_TRUE;
640 }
641 
642 /*
643  * Compute the name of the executable
644  *
645  * In order to re-exec securely we need the absolute path of the
646  * executable. On Solaris getexecname(3c) may not return an absolute
647  * path so we use dladdr to get the filename of the executable and
648  * then use realpath to derive an absolute path. From Solaris 9
649  * onwards the filename returned in DL_info structure from dladdr is
650  * an absolute pathname so technically realpath isn't required.
651  * On Linux we read the executable name from /proc/self/exe.
652  * As a fallback, and for platforms other than Solaris and Linux,
653  * we use FindExecName to compute the executable name.
654  */
655 const char*
656 SetExecname(char **argv)
657 {
658     char* exec_path = NULL;
< prev index next >