289 Arguments::set_ext_dirs(buf); |
289 Arguments::set_ext_dirs(buf); |
290 } |
290 } |
291 #undef EXT_DIR |
291 #undef EXT_DIR |
292 #undef BIN_DIR |
292 #undef BIN_DIR |
293 #undef PACKAGE_DIR |
293 #undef PACKAGE_DIR |
294 |
|
295 // Default endorsed standards directory. |
|
296 { |
|
297 #define ENDORSED_DIR "\\lib\\endorsed" |
|
298 size_t len = strlen(Arguments::get_java_home()) + sizeof(ENDORSED_DIR); |
|
299 char * buf = NEW_C_HEAP_ARRAY(char, len, mtInternal); |
|
300 sprintf(buf, "%s%s", Arguments::get_java_home(), ENDORSED_DIR); |
|
301 Arguments::set_endorsed_dirs(buf); |
|
302 // (Arguments::set_endorsed_dirs() calls SystemProperty::set_value(), which |
|
303 // duplicates the input.) |
|
304 FREE_C_HEAP_ARRAY(char, buf, mtInternal); |
|
305 #undef ENDORSED_DIR |
|
306 } |
|
307 |
294 |
308 #ifndef _WIN64 |
295 #ifndef _WIN64 |
309 // set our UnhandledExceptionFilter and save any previous one |
296 // set our UnhandledExceptionFilter and save any previous one |
310 prev_uef_handler = SetUnhandledExceptionFilter(Handle_FLT_Exception); |
297 prev_uef_handler = SetUnhandledExceptionFilter(Handle_FLT_Exception); |
311 #endif |
298 #endif |
4374 |
4361 |
4375 jlong os::lseek(int fd, jlong offset, int whence) { |
4362 jlong os::lseek(int fd, jlong offset, int whence) { |
4376 return (jlong) ::_lseeki64(fd, offset, whence); |
4363 return (jlong) ::_lseeki64(fd, offset, whence); |
4377 } |
4364 } |
4378 |
4365 |
|
4366 size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) { |
|
4367 OVERLAPPED ov; |
|
4368 DWORD nread; |
|
4369 BOOL result; |
|
4370 |
|
4371 ZeroMemory(&ov, sizeof(ov)); |
|
4372 ov.Offset = (DWORD)offset; |
|
4373 ov.OffsetHigh = (DWORD)(offset >> 32); |
|
4374 |
|
4375 HANDLE h = (HANDLE)::_get_osfhandle(fd); |
|
4376 |
|
4377 result = ReadFile(h, (LPVOID)buf, nBytes, &nread, &ov); |
|
4378 |
|
4379 return result ? nread : 0; |
|
4380 } |
|
4381 |
|
4382 |
4379 // This method is a slightly reworked copy of JDK's sysNativePath |
4383 // This method is a slightly reworked copy of JDK's sysNativePath |
4380 // from src/windows/hpi/src/path_md.c |
4384 // from src/windows/hpi/src/path_md.c |
4381 |
4385 |
4382 // Convert a pathname to native format. On win32, this involves forcing all |
4386 // Convert a pathname to native format. On win32, this involves forcing all |
4383 // separators to be '\\' rather than '/' (both are legal inputs, but Win95 |
4387 // separators to be '\\' rather than '/' (both are legal inputs, but Win95 |