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); |
|
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 |
4389 |
4376 |
4390 jlong os::lseek(int fd, jlong offset, int whence) { |
4377 jlong os::lseek(int fd, jlong offset, int whence) { |
4391 return (jlong) ::_lseeki64(fd, offset, whence); |
4378 return (jlong) ::_lseeki64(fd, offset, whence); |
4392 } |
4379 } |
4393 |
4380 |
|
4381 size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) { |
|
4382 OVERLAPPED ov; |
|
4383 DWORD nread; |
|
4384 BOOL result; |
|
4385 |
|
4386 ZeroMemory(&ov, sizeof(ov)); |
|
4387 ov.Offset = (DWORD)offset; |
|
4388 ov.OffsetHigh = (DWORD)(offset >> 32); |
|
4389 |
|
4390 HANDLE h = (HANDLE)::_get_osfhandle(fd); |
|
4391 |
|
4392 result = ReadFile(h, (LPVOID)buf, nBytes, &nread, &ov); |
|
4393 |
|
4394 return result ? nread : 0; |
|
4395 } |
|
4396 |
|
4397 |
4394 // This method is a slightly reworked copy of JDK's sysNativePath |
4398 // This method is a slightly reworked copy of JDK's sysNativePath |
4395 // from src/windows/hpi/src/path_md.c |
4399 // from src/windows/hpi/src/path_md.c |
4396 |
4400 |
4397 // Convert a pathname to native format. On win32, this involves forcing all |
4401 // Convert a pathname to native format. On win32, this involves forcing all |
4398 // separators to be '\\' rather than '/' (both are legal inputs, but Win95 |
4402 // separators to be '\\' rather than '/' (both are legal inputs, but Win95 |