285 if (is_allocatable(temp_limit)) { 286 lower_limit = temp_limit; 287 } else { 288 upper_limit = temp_limit; 289 } 290 } 291 *limit = lower_limit; 292 } 293 return true; 294 #endif 295 } 296 297 const char* os::get_current_directory(char *buf, size_t buflen) { 298 return getcwd(buf, buflen); 299 } 300 301 FILE* os::open(int fd, const char* mode) { 302 return ::fdopen(fd, mode); 303 } 304 305 // Builds a platform dependent Agent_OnLoad_<lib_name> function name 306 // which is used to find statically linked in agents. 307 // Parameters: 308 // sym_name: Symbol in library we are looking for 309 // lib_name: Name of library to look in, NULL for shared libs. 310 // is_absolute_path == true if lib_name is absolute path to agent 311 // such as "/a/b/libL.so" 312 // == false if only the base name of the library is passed in 313 // such as "L" 314 char* os::build_agent_function_name(const char *sym_name, const char *lib_name, 315 bool is_absolute_path) { 316 char *agent_entry_name; 317 size_t len; 318 size_t name_len; 319 size_t prefix_len = strlen(JNI_LIB_PREFIX); 320 size_t suffix_len = strlen(JNI_LIB_SUFFIX); 321 const char *start; 322 323 if (lib_name != NULL) { 324 len = name_len = strlen(lib_name); | 285 if (is_allocatable(temp_limit)) { 286 lower_limit = temp_limit; 287 } else { 288 upper_limit = temp_limit; 289 } 290 } 291 *limit = lower_limit; 292 } 293 return true; 294 #endif 295 } 296 297 const char* os::get_current_directory(char *buf, size_t buflen) { 298 return getcwd(buf, buflen); 299 } 300 301 FILE* os::open(int fd, const char* mode) { 302 return ::fdopen(fd, mode); 303 } 304 305 DIR* os::opendir(const char* dirname) { 306 assert(dirname != NULL, "just checking"); 307 return ::opendir(dirname); 308 } 309 310 struct dirent* os::readdir(DIR* dirp) { 311 assert(dirp != NULL, "just checking"); 312 return ::readdir(dirp); 313 } 314 315 int os::closedir(DIR *dirp) { 316 assert(dirp != NULL, "just checking"); 317 return ::closedir(dirp); 318 } 319 320 // Builds a platform dependent Agent_OnLoad_<lib_name> function name 321 // which is used to find statically linked in agents. 322 // Parameters: 323 // sym_name: Symbol in library we are looking for 324 // lib_name: Name of library to look in, NULL for shared libs. 325 // is_absolute_path == true if lib_name is absolute path to agent 326 // such as "/a/b/libL.so" 327 // == false if only the base name of the library is passed in 328 // such as "L" 329 char* os::build_agent_function_name(const char *sym_name, const char *lib_name, 330 bool is_absolute_path) { 331 char *agent_entry_name; 332 size_t len; 333 size_t name_len; 334 size_t prefix_len = strlen(JNI_LIB_PREFIX); 335 size_t suffix_len = strlen(JNI_LIB_SUFFIX); 336 const char *start; 337 338 if (lib_name != NULL) { 339 len = name_len = strlen(lib_name); |