1651 void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) {
1652 // do nothing
1653 }
1654
1655 static char saved_jvm_path[MAX_PATH] = {0};
1656
1657 // Find the full path to the current module, jvm.dll or jvm_g.dll
1658 void os::jvm_path(char *buf, jint buflen) {
1659 // Error checking.
1660 if (buflen < MAX_PATH) {
1661 assert(false, "must use a large-enough buffer");
1662 buf[0] = '\0';
1663 return;
1664 }
1665 // Lazy resolve the path to current module.
1666 if (saved_jvm_path[0] != 0) {
1667 strcpy(buf, saved_jvm_path);
1668 return;
1669 }
1670
1671 GetModuleFileName(vm_lib_handle, buf, buflen);
1672 strcpy(saved_jvm_path, buf);
1673 }
1674
1675
1676 void os::print_jni_name_prefix_on(outputStream* st, int args_size) {
1677 #ifndef _WIN64
1678 st->print("_");
1679 #endif
1680 }
1681
1682
1683 void os::print_jni_name_suffix_on(outputStream* st, int args_size) {
1684 #ifndef _WIN64
1685 st->print("@%d", args_size * sizeof(int));
1686 #endif
1687 }
1688
1689 // sun.misc.Signal
1690 // NOTE that this is a workaround for an apparent kernel bug where if
1691 // a signal handler for SIGBREAK is installed then that signal handler
|
1651 void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) {
1652 // do nothing
1653 }
1654
1655 static char saved_jvm_path[MAX_PATH] = {0};
1656
1657 // Find the full path to the current module, jvm.dll or jvm_g.dll
1658 void os::jvm_path(char *buf, jint buflen) {
1659 // Error checking.
1660 if (buflen < MAX_PATH) {
1661 assert(false, "must use a large-enough buffer");
1662 buf[0] = '\0';
1663 return;
1664 }
1665 // Lazy resolve the path to current module.
1666 if (saved_jvm_path[0] != 0) {
1667 strcpy(buf, saved_jvm_path);
1668 return;
1669 }
1670
1671 buf[0] = '\0';
1672 if (strcmp(Arguments::sun_java_launcher(), "gamma") == 0) {
1673 // Support for the gamma launcher. Check for a JAVA_HOME
1674 // environment variable and fix up the path so it looks like
1675 // libjvm.so is installed there (append a fake suffix
1676 // hotspot/libjvm.so).
1677 char* java_home_var = ::getenv("JAVA_HOME");
1678 if (java_home_var != NULL && java_home_var[0] != 0) {
1679
1680 strncpy(buf, java_home_var, buflen);
1681
1682 // determine if this is a legacy image or modules image
1683 // modules image doesn't have "jre" subdirectory
1684 size_t len = strlen(buf);
1685 char* jrebin_p = buf + len;
1686 jio_snprintf(jrebin_p, buflen-len, "\\jre\\bin\\");
1687 if (0 != _access(buf, 0)) {
1688 jio_snprintf(jrebin_p, buflen-len, "\\bin\\");
1689 }
1690 len = strlen(buf);
1691 jio_snprintf(buf + len, buflen-len, "hotspot\\jvm.dll");
1692 }
1693 }
1694
1695 if(buf[0] == '\0') {
1696 GetModuleFileName(vm_lib_handle, buf, buflen);
1697 }
1698 strcpy(saved_jvm_path, buf);
1699 }
1700
1701
1702 void os::print_jni_name_prefix_on(outputStream* st, int args_size) {
1703 #ifndef _WIN64
1704 st->print("_");
1705 #endif
1706 }
1707
1708
1709 void os::print_jni_name_suffix_on(outputStream* st, int args_size) {
1710 #ifndef _WIN64
1711 st->print("@%d", args_size * sizeof(int));
1712 #endif
1713 }
1714
1715 // sun.misc.Signal
1716 // NOTE that this is a workaround for an apparent kernel bug where if
1717 // a signal handler for SIGBREAK is installed then that signal handler
|