hotspot/src/os/solaris/vm/os_solaris.cpp
changeset 27562 47f369e3c69c
parent 27474 2b061fd571eb
child 27711 0b952ebd3953
equal deleted inserted replaced
27561:7ead528de130 27562:47f369e3c69c
   607   // code needs to be changed accordingly.
   607   // code needs to be changed accordingly.
   608 
   608 
   609 // Base path of extensions installed on the system.
   609 // Base path of extensions installed on the system.
   610 #define SYS_EXT_DIR     "/usr/jdk/packages"
   610 #define SYS_EXT_DIR     "/usr/jdk/packages"
   611 #define EXTENSIONS_DIR  "/lib/ext"
   611 #define EXTENSIONS_DIR  "/lib/ext"
   612 #define ENDORSED_DIR    "/lib/endorsed"
       
   613 
   612 
   614   char cpu_arch[12];
   613   char cpu_arch[12];
   615   // Buffer that fits several sprintfs.
   614   // Buffer that fits several sprintfs.
   616   // Note that the space for the colon and the trailing null are provided
   615   // Note that the space for the colon and the trailing null are provided
   617   // by the nulls included by the sizeof operator.
   616   // by the nulls included by the sizeof operator.
   618   const size_t bufsize =
   617   const size_t bufsize =
   619     MAX4((size_t)MAXPATHLEN,  // For dll_dir & friends.
   618     MAX3((size_t)MAXPATHLEN,  // For dll_dir & friends.
   620          sizeof(SYS_EXT_DIR) + sizeof("/lib/") + strlen(cpu_arch), // invariant ld_library_path
   619          sizeof(SYS_EXT_DIR) + sizeof("/lib/") + strlen(cpu_arch), // invariant ld_library_path
   621          (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR), // extensions dir
   620          (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir
   622          (size_t)MAXPATHLEN + sizeof(ENDORSED_DIR)); // endorsed dir
       
   623   char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
   621   char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
   624 
   622 
   625   // sysclasspath, java_home, dll_dir
   623   // sysclasspath, java_home, dll_dir
   626   {
   624   {
   627     char *pslash;
   625     char *pslash;
   763 
   761 
   764   // Extensions directories.
   762   // Extensions directories.
   765   sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
   763   sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
   766   Arguments::set_ext_dirs(buf);
   764   Arguments::set_ext_dirs(buf);
   767 
   765 
   768   // Endorsed standards default directory.
       
   769   sprintf(buf, "%s" ENDORSED_DIR, Arguments::get_java_home());
       
   770   Arguments::set_endorsed_dirs(buf);
       
   771 
       
   772   FREE_C_HEAP_ARRAY(char, buf, mtInternal);
   766   FREE_C_HEAP_ARRAY(char, buf, mtInternal);
   773 
   767 
   774 #undef SYS_EXT_DIR
   768 #undef SYS_EXT_DIR
   775 #undef EXTENSIONS_DIR
   769 #undef EXTENSIONS_DIR
   776 #undef ENDORSED_DIR
       
   777 }
   770 }
   778 
   771 
   779 void os::breakpoint() {
   772 void os::breakpoint() {
   780   BREAKPOINT;
   773   BREAKPOINT;
   781 }
   774 }
  3159   size_t res;
  3152   size_t res;
  3160   JavaThread* thread = (JavaThread*)Thread::current();
  3153   JavaThread* thread = (JavaThread*)Thread::current();
  3161   assert(thread->thread_state() == _thread_in_vm, "Assumed _thread_in_vm");
  3154   assert(thread->thread_state() == _thread_in_vm, "Assumed _thread_in_vm");
  3162   ThreadBlockInVM tbiv(thread);
  3155   ThreadBlockInVM tbiv(thread);
  3163   RESTARTABLE(::read(fd, buf, (size_t) nBytes), res);
  3156   RESTARTABLE(::read(fd, buf, (size_t) nBytes), res);
       
  3157   return res;
       
  3158 }
       
  3159 
       
  3160 size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
       
  3161   size_t res;
       
  3162   JavaThread* thread = (JavaThread*)Thread::current();
       
  3163   assert(thread->thread_state() == _thread_in_vm, "Assumed _thread_in_vm");
       
  3164   ThreadBlockInVM tbiv(thread);
       
  3165   RESTARTABLE(::pread(fd, buf, (size_t) nBytes, offset), res);
  3164   return res;
  3166   return res;
  3165 }
  3167 }
  3166 
  3168 
  3167 size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) {
  3169 size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) {
  3168   size_t res;
  3170   size_t res;