< prev index next >

src/hotspot/os/aix/os_aix.cpp

Print this page

 537   assert0(g_multipage_support.pthr_stack_pagesize == g_multipage_support.datapsize);
 538   assert0(g_multipage_support.shmpsize == 4*K || g_multipage_support.shmpsize == 64*K);
 539 
 540 }
 541 
 542 void os::init_system_properties_values() {
 543 
 544 #ifndef OVERRIDE_LIBPATH
 545   #define DEFAULT_LIBPATH "/lib:/usr/lib"
 546 #else
 547   #define DEFAULT_LIBPATH OVERRIDE_LIBPATH
 548 #endif
 549 #define EXTENSIONS_DIR  "/lib/ext"
 550 
 551   // Buffer that fits several sprintfs.
 552   // Note that the space for the trailing null is provided
 553   // by the nulls included by the sizeof operator.
 554   const size_t bufsize =
 555     MAX2((size_t)MAXPATHLEN,  // For dll_dir & friends.
 556          (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR)); // extensions dir
 557   char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
 558 
 559   // sysclasspath, java_home, dll_dir
 560   {
 561     char *pslash;
 562     os::jvm_path(buf, bufsize);
 563 
 564     // Found the full path to libjvm.so.
 565     // Now cut the path to <java_home>/jre if we can.
 566     pslash = strrchr(buf, '/');
 567     if (pslash != NULL) {
 568       *pslash = '\0';            // Get rid of /libjvm.so.
 569     }
 570     pslash = strrchr(buf, '/');
 571     if (pslash != NULL) {
 572       *pslash = '\0';            // Get rid of /{client|server|hotspot}.
 573     }
 574     Arguments::set_dll_dir(buf);
 575 
 576     if (pslash != NULL) {
 577       pslash = strrchr(buf, '/');

 579         *pslash = '\0';        // Get rid of /lib.
 580       }
 581     }
 582     Arguments::set_java_home(buf);
 583     if (!set_boot_path('/', ':')) {
 584       vm_exit_during_initialization("Failed setting boot class path.", NULL);
 585     }
 586   }
 587 
 588   // Where to look for native libraries.
 589 
 590   // On Aix we get the user setting of LIBPATH.
 591   // Eventually, all the library path setting will be done here.
 592   // Get the user setting of LIBPATH.
 593   const char *v = ::getenv("LIBPATH");
 594   const char *v_colon = ":";
 595   if (v == NULL) { v = ""; v_colon = ""; }
 596 
 597   // Concatenate user and invariant part of ld_library_path.
 598   // That's +1 for the colon and +1 for the trailing '\0'.
 599   char *ld_library_path = (char *)NEW_C_HEAP_ARRAY(char, strlen(v) + 1 + sizeof(DEFAULT_LIBPATH) + 1, mtInternal);
 600   sprintf(ld_library_path, "%s%s" DEFAULT_LIBPATH, v, v_colon);
 601   Arguments::set_library_path(ld_library_path);
 602   FREE_C_HEAP_ARRAY(char, ld_library_path);
 603 
 604   // Extensions directories.
 605   sprintf(buf, "%s" EXTENSIONS_DIR, Arguments::get_java_home());
 606   Arguments::set_ext_dirs(buf);
 607 
 608   FREE_C_HEAP_ARRAY(char, buf);
 609 
 610 #undef DEFAULT_LIBPATH
 611 #undef EXTENSIONS_DIR
 612 }
 613 
 614 ////////////////////////////////////////////////////////////////////////////////
 615 // breakpoint support
 616 
 617 void os::breakpoint() {
 618   BREAKPOINT;
 619 }

 537   assert0(g_multipage_support.pthr_stack_pagesize == g_multipage_support.datapsize);
 538   assert0(g_multipage_support.shmpsize == 4*K || g_multipage_support.shmpsize == 64*K);
 539 
 540 }
 541 
 542 void os::init_system_properties_values() {
 543 
 544 #ifndef OVERRIDE_LIBPATH
 545   #define DEFAULT_LIBPATH "/lib:/usr/lib"
 546 #else
 547   #define DEFAULT_LIBPATH OVERRIDE_LIBPATH
 548 #endif
 549 #define EXTENSIONS_DIR  "/lib/ext"
 550 
 551   // Buffer that fits several sprintfs.
 552   // Note that the space for the trailing null is provided
 553   // by the nulls included by the sizeof operator.
 554   const size_t bufsize =
 555     MAX2((size_t)MAXPATHLEN,  // For dll_dir & friends.
 556          (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR)); // extensions dir
 557   char *buf = NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
 558 
 559   // sysclasspath, java_home, dll_dir
 560   {
 561     char *pslash;
 562     os::jvm_path(buf, bufsize);
 563 
 564     // Found the full path to libjvm.so.
 565     // Now cut the path to <java_home>/jre if we can.
 566     pslash = strrchr(buf, '/');
 567     if (pslash != NULL) {
 568       *pslash = '\0';            // Get rid of /libjvm.so.
 569     }
 570     pslash = strrchr(buf, '/');
 571     if (pslash != NULL) {
 572       *pslash = '\0';            // Get rid of /{client|server|hotspot}.
 573     }
 574     Arguments::set_dll_dir(buf);
 575 
 576     if (pslash != NULL) {
 577       pslash = strrchr(buf, '/');

 579         *pslash = '\0';        // Get rid of /lib.
 580       }
 581     }
 582     Arguments::set_java_home(buf);
 583     if (!set_boot_path('/', ':')) {
 584       vm_exit_during_initialization("Failed setting boot class path.", NULL);
 585     }
 586   }
 587 
 588   // Where to look for native libraries.
 589 
 590   // On Aix we get the user setting of LIBPATH.
 591   // Eventually, all the library path setting will be done here.
 592   // Get the user setting of LIBPATH.
 593   const char *v = ::getenv("LIBPATH");
 594   const char *v_colon = ":";
 595   if (v == NULL) { v = ""; v_colon = ""; }
 596 
 597   // Concatenate user and invariant part of ld_library_path.
 598   // That's +1 for the colon and +1 for the trailing '\0'.
 599   char *ld_library_path = NEW_C_HEAP_ARRAY(char, strlen(v) + 1 + sizeof(DEFAULT_LIBPATH) + 1, mtInternal);
 600   sprintf(ld_library_path, "%s%s" DEFAULT_LIBPATH, v, v_colon);
 601   Arguments::set_library_path(ld_library_path);
 602   FREE_C_HEAP_ARRAY(char, ld_library_path);
 603 
 604   // Extensions directories.
 605   sprintf(buf, "%s" EXTENSIONS_DIR, Arguments::get_java_home());
 606   Arguments::set_ext_dirs(buf);
 607 
 608   FREE_C_HEAP_ARRAY(char, buf);
 609 
 610 #undef DEFAULT_LIBPATH
 611 #undef EXTENSIONS_DIR
 612 }
 613 
 614 ////////////////////////////////////////////////////////////////////////////////
 615 // breakpoint support
 616 
 617 void os::breakpoint() {
 618   BREAKPOINT;
 619 }
< prev index next >