1520 |
1520 |
1521 // DLL functions |
1521 // DLL functions |
1522 |
1522 |
1523 const char* os::dll_file_extension() { return ".so"; } |
1523 const char* os::dll_file_extension() { return ".so"; } |
1524 |
1524 |
1525 const char* os::get_temp_directory() { return "/tmp/"; } |
1525 const char* os::get_temp_directory() { |
|
1526 const char *prop = Arguments::get_property("java.io.tmpdir"); |
|
1527 return prop == NULL ? "/tmp" : prop; |
|
1528 } |
1526 |
1529 |
1527 static bool file_exists(const char* filename) { |
1530 static bool file_exists(const char* filename) { |
1528 struct stat statbuf; |
1531 struct stat statbuf; |
1529 if (filename == NULL || strlen(filename) == 0) { |
1532 if (filename == NULL || strlen(filename) == 0) { |
1530 return false; |
1533 return false; |
2303 } |
2306 } |
2304 |
2307 |
2305 char buf[40]; |
2308 char buf[40]; |
2306 int num = Atomic::add(1, &cnt); |
2309 int num = Atomic::add(1, &cnt); |
2307 |
2310 |
2308 sprintf(buf, "/tmp/hs-vm-%d-%d", os::current_process_id(), num); |
2311 snprintf(buf, sizeof(buf), "%s/hs-vm-%d-%d", |
|
2312 os::get_temp_directory(), os::current_process_id(), num); |
2309 unlink(buf); |
2313 unlink(buf); |
2310 |
2314 |
2311 int fd = open(buf, O_CREAT | O_RDWR, S_IRWXU); |
2315 int fd = open(buf, O_CREAT | O_RDWR, S_IRWXU); |
2312 |
2316 |
2313 if (fd != -1) { |
2317 if (fd != -1) { |