hotspot/src/share/vm/classfile/sharedPathsMiscInfo.hpp
changeset 41281 e1dc38ba642f
parent 40013 943cf01a6b82
child 42876 ff8ff9dcccec
equal deleted inserted replaced
41279:5a7c83da4a2d 41281:e1dc38ba642f
   102   // The path must not exist at run-time
   102   // The path must not exist at run-time
   103   void add_nonexist_path(const char* path) {
   103   void add_nonexist_path(const char* path) {
   104     add_path(path, NON_EXIST);
   104     add_path(path, NON_EXIST);
   105   }
   105   }
   106 
   106 
       
   107   // The path must exist and have required size and modification time
       
   108   void add_required_file(const char* path) {
       
   109     add_path(path, REQUIRED);
       
   110 
       
   111     struct stat st;
       
   112     if (os::stat(path, &st) != 0) {
       
   113       assert(0, "sanity");
       
   114 #if INCLUDE_CDS
       
   115       ClassLoader::exit_with_path_failure("failed to os::stat(%s)", path); // should not happen
       
   116 #endif
       
   117     }
       
   118     write_time(st.st_mtime);
       
   119     write_long(st.st_size);
       
   120   }
       
   121 
   107   // The path must exist, and must contain exactly <num_entries> files/dirs
   122   // The path must exist, and must contain exactly <num_entries> files/dirs
   108   void add_boot_classpath(const char* path) {
   123   void add_boot_classpath(const char* path) {
   109     add_path(path, BOOT);
   124     add_path(path, BOOT);
       
   125   }
       
   126   void add_patch_mod_classpath(const char* path) {
       
   127     add_path(path, PATCH_MOD);
   110   }
   128   }
   111   int write_jint(jint num) {
   129   int write_jint(jint num) {
   112     write(&num, sizeof(num));
   130     write(&num, sizeof(num));
   113     return 0;
   131     return 0;
   114   }
   132   }
   127   // reading --
   145   // reading --
   128 
   146 
   129   enum {
   147   enum {
   130     BOOT      = 1,
   148     BOOT      = 1,
   131     NON_EXIST = 2,
   149     NON_EXIST = 2,
   132     REQUIRED  = 3
   150     REQUIRED  = 3,
       
   151     PATCH_MOD = 4
   133   };
   152   };
   134 
   153 
   135   virtual const char* type_name(int type) {
   154   virtual const char* type_name(int type) {
   136     switch (type) {
   155     switch (type) {
   137     case BOOT:      return "BOOT";
   156     case BOOT:      return "BOOT";
   138     case NON_EXIST: return "NON_EXIST";
   157     case NON_EXIST: return "NON_EXIST";
   139     case REQUIRED:  return "REQUIRED";
   158     case REQUIRED:  return "REQUIRED";
       
   159     case PATCH_MOD: return "PATCH_MOD";
   140     default:        ShouldNotReachHere(); return "?";
   160     default:        ShouldNotReachHere(); return "?";
   141     }
   161     }
   142   }
   162   }
   143 
   163 
   144   virtual void print_path(int type, const char* path);
   164   virtual void print_path(int type, const char* path);