src/hotspot/os/linux/os_linux.cpp
changeset 58083 9046db64ca39
parent 57804 9b7b9f16dfd9
child 58654 562bf1878089
equal deleted inserted replaced
58081:8b08eaf9a0eb 58083:9046db64ca39
   426   // Note that the space for the colon and the trailing null are provided
   426   // Note that the space for the colon and the trailing null are provided
   427   // by the nulls included by the sizeof operator.
   427   // by the nulls included by the sizeof operator.
   428   const size_t bufsize =
   428   const size_t bufsize =
   429     MAX2((size_t)MAXPATHLEN,  // For dll_dir & friends.
   429     MAX2((size_t)MAXPATHLEN,  // For dll_dir & friends.
   430          (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir
   430          (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir
   431   char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
   431   char *buf = NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
   432 
   432 
   433   // sysclasspath, java_home, dll_dir
   433   // sysclasspath, java_home, dll_dir
   434   {
   434   {
   435     char *pslash;
   435     char *pslash;
   436     os::jvm_path(buf, bufsize);
   436     os::jvm_path(buf, bufsize);
   475     // addressed).
   475     // addressed).
   476     const char *v = ::getenv("LD_LIBRARY_PATH");
   476     const char *v = ::getenv("LD_LIBRARY_PATH");
   477     const char *v_colon = ":";
   477     const char *v_colon = ":";
   478     if (v == NULL) { v = ""; v_colon = ""; }
   478     if (v == NULL) { v = ""; v_colon = ""; }
   479     // That's +1 for the colon and +1 for the trailing '\0'.
   479     // That's +1 for the colon and +1 for the trailing '\0'.
   480     char *ld_library_path = (char *)NEW_C_HEAP_ARRAY(char,
   480     char *ld_library_path = NEW_C_HEAP_ARRAY(char,
   481                                                      strlen(v) + 1 +
   481                                              strlen(v) + 1 +
   482                                                      sizeof(SYS_EXT_DIR) + sizeof("/lib/") + sizeof(DEFAULT_LIBPATH) + 1,
   482                                              sizeof(SYS_EXT_DIR) + sizeof("/lib/") + sizeof(DEFAULT_LIBPATH) + 1,
   483                                                      mtInternal);
   483                                              mtInternal);
   484     sprintf(ld_library_path, "%s%s" SYS_EXT_DIR "/lib:" DEFAULT_LIBPATH, v, v_colon);
   484     sprintf(ld_library_path, "%s%s" SYS_EXT_DIR "/lib:" DEFAULT_LIBPATH, v, v_colon);
   485     Arguments::set_library_path(ld_library_path);
   485     Arguments::set_library_path(ld_library_path);
   486     FREE_C_HEAP_ARRAY(char, ld_library_path);
   486     FREE_C_HEAP_ARRAY(char, ld_library_path);
   487   }
   487   }
   488 
   488