comparison src/os/windows/vm/os_windows.cpp @ 4970:33df1aeaebbf

Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Mon, 27 Feb 2012 13:10:13 +0100
parents acf7d88327fa 379b22e03c32
children 18a5539bf19b
comparison
equal deleted inserted replaced
4703:2cfb7fb2dce7 4970:33df1aeaebbf
1 /* 1 /*
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
130 #endif 130 #endif
131 131
132 // save DLL module handle, used by GetModuleFileName 132 // save DLL module handle, used by GetModuleFileName
133 133
134 HINSTANCE vm_lib_handle; 134 HINSTANCE vm_lib_handle;
135 static int getLastErrorString(char *buf, size_t len);
136 135
137 BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) { 136 BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) {
138 switch (reason) { 137 switch (reason) {
139 case DLL_PROCESS_ATTACH: 138 case DLL_PROCESS_ATTACH:
140 vm_lib_handle = hinst; 139 vm_lib_handle = hinst;
818 GetSystemTimeAsFileTime(&wt); 817 GetSystemTimeAsFileTime(&wt);
819 return windows_to_java_time(wt); 818 return windows_to_java_time(wt);
820 } 819 }
821 } 820 }
822 821
823 #define NANOS_PER_SEC CONST64(1000000000)
824 #define NANOS_PER_MILLISEC 1000000
825 jlong os::javaTimeNanos() { 822 jlong os::javaTimeNanos() {
826 if (!has_performance_count) { 823 if (!has_performance_count) {
827 return javaTimeMillis() * NANOS_PER_MILLISEC; // the best we can do. 824 return javaTimeMillis() * NANOSECS_PER_MILLISEC; // the best we can do.
828 } else { 825 } else {
829 LARGE_INTEGER current_count; 826 LARGE_INTEGER current_count;
830 QueryPerformanceCounter(&current_count); 827 QueryPerformanceCounter(&current_count);
831 double current = as_long(current_count); 828 double current = as_long(current_count);
832 double freq = performance_frequency; 829 double freq = performance_frequency;
833 jlong time = (jlong)((current/freq) * NANOS_PER_SEC); 830 jlong time = (jlong)((current/freq) * NANOSECS_PER_SEC);
834 return time; 831 return time;
835 } 832 }
836 } 833 }
837 834
838 void os::javaTimeNanos_info(jvmtiTimerInfo *info_ptr) { 835 void os::javaTimeNanos_info(jvmtiTimerInfo *info_ptr) {
844 // this is a wall clock timer, so may skip 841 // this is a wall clock timer, so may skip
845 info_ptr->may_skip_backward = true; 842 info_ptr->may_skip_backward = true;
846 info_ptr->may_skip_forward = true; 843 info_ptr->may_skip_forward = true;
847 } else { 844 } else {
848 jlong freq = performance_frequency; 845 jlong freq = performance_frequency;
849 if (freq < NANOS_PER_SEC) { 846 if (freq < NANOSECS_PER_SEC) {
850 // the performance counter is 64 bits and we will 847 // the performance counter is 64 bits and we will
851 // be multiplying it -- so no wrap in 64 bits 848 // be multiplying it -- so no wrap in 64 bits
852 info_ptr->max_value = ALL_64_BITS; 849 info_ptr->max_value = ALL_64_BITS;
853 } else if (freq > NANOS_PER_SEC) { 850 } else if (freq > NANOSECS_PER_SEC) {
854 // use the max value the counter can reach to 851 // use the max value the counter can reach to
855 // determine the max value which could be returned 852 // determine the max value which could be returned
856 julong max_counter = (julong)ALL_64_BITS; 853 julong max_counter = (julong)ALL_64_BITS;
857 info_ptr->max_value = (jlong)(max_counter / (freq / NANOS_PER_SEC)); 854 info_ptr->max_value = (jlong)(max_counter / (freq / NANOSECS_PER_SEC));
858 } else { 855 } else {
859 // the performance counter is 64 bits and we will 856 // the performance counter is 64 bits and we will
860 // be using it directly -- so no wrap in 64 bits 857 // be using it directly -- so no wrap in 64 bits
861 info_ptr->max_value = ALL_64_BITS; 858 info_ptr->max_value = ALL_64_BITS;
862 } 859 }
1391 } 1388 }
1392 } 1389 }
1393 1390
1394 bool os::dll_address_to_function_name(address addr, char *buf, 1391 bool os::dll_address_to_function_name(address addr, char *buf,
1395 int buflen, int *offset) { 1392 int buflen, int *offset) {
1396 if (Decoder::decode(addr, buf, buflen, offset) == Decoder::no_error) { 1393 if (Decoder::decode(addr, buf, buflen, offset)) {
1397 return true; 1394 return true;
1398 } 1395 }
1399 if (offset != NULL) *offset = -1; 1396 if (offset != NULL) *offset = -1;
1400 if (buf != NULL) buf[0] = '\0'; 1397 if (buf != NULL) buf[0] = '\0';
1401 return false; 1398 return false;
1451 if (result != NULL) 1448 if (result != NULL)
1452 { 1449 {
1453 return result; 1450 return result;
1454 } 1451 }
1455 1452
1456 long errcode = GetLastError(); 1453 DWORD errcode = GetLastError();
1457 if (errcode == ERROR_MOD_NOT_FOUND) { 1454 if (errcode == ERROR_MOD_NOT_FOUND) {
1458 strncpy(ebuf, "Can't find dependent libraries", ebuflen-1); 1455 strncpy(ebuf, "Can't find dependent libraries", ebuflen-1);
1459 ebuf[ebuflen-1]='\0'; 1456 ebuf[ebuflen-1]='\0';
1460 return NULL; 1457 return NULL;
1461 } 1458 }
1462 1459
1463 // Parsing dll below 1460 // Parsing dll below
1464 // If we can read dll-info and find that dll was built 1461 // If we can read dll-info and find that dll was built
1465 // for an architecture other than Hotspot is running in 1462 // for an architecture other than Hotspot is running in
1466 // - then print to buffer "DLL was built for a different architecture" 1463 // - then print to buffer "DLL was built for a different architecture"
1467 // else call getLastErrorString to obtain system error message 1464 // else call os::lasterror to obtain system error message
1468 1465
1469 // Read system error message into ebuf 1466 // Read system error message into ebuf
1470 // It may or may not be overwritten below (in the for loop and just above) 1467 // It may or may not be overwritten below (in the for loop and just above)
1471 getLastErrorString(ebuf, (size_t) ebuflen); 1468 lasterror(ebuf, (size_t) ebuflen);
1472 ebuf[ebuflen-1]='\0'; 1469 ebuf[ebuflen-1]='\0';
1473 int file_descriptor=::open(name, O_RDONLY | O_BINARY, 0); 1470 int file_descriptor=::open(name, O_RDONLY | O_BINARY, 0);
1474 if (file_descriptor<0) 1471 if (file_descriptor<0)
1475 { 1472 {
1476 return NULL; 1473 return NULL;
1499 ); 1496 );
1500 1497
1501 ::close(file_descriptor); 1498 ::close(file_descriptor);
1502 if (failed_to_get_lib_arch) 1499 if (failed_to_get_lib_arch)
1503 { 1500 {
1504 // file i/o error - report getLastErrorString(...) msg 1501 // file i/o error - report os::lasterror(...) msg
1505 return NULL; 1502 return NULL;
1506 } 1503 }
1507 1504
1508 typedef struct 1505 typedef struct
1509 { 1506 {
1542 1539
1543 assert(running_arch_str, 1540 assert(running_arch_str,
1544 "Didn't find runing architecture code in arch_array"); 1541 "Didn't find runing architecture code in arch_array");
1545 1542
1546 // If the architure is right 1543 // If the architure is right
1547 // but some other error took place - report getLastErrorString(...) msg 1544 // but some other error took place - report os::lasterror(...) msg
1548 if (lib_arch == running_arch) 1545 if (lib_arch == running_arch)
1549 { 1546 {
1550 return NULL; 1547 return NULL;
1551 } 1548 }
1552 1549
1774 } 1771 }
1775 1772
1776 // This method is a copy of JDK's sysGetLastErrorString 1773 // This method is a copy of JDK's sysGetLastErrorString
1777 // from src/windows/hpi/src/system_md.c 1774 // from src/windows/hpi/src/system_md.c
1778 1775
1779 size_t os::lasterror(char *buf, size_t len) { 1776 size_t os::lasterror(char* buf, size_t len) {
1780 long errval; 1777 DWORD errval;
1781 1778
1782 if ((errval = GetLastError()) != 0) { 1779 if ((errval = GetLastError()) != 0) {
1783 /* DOS error */ 1780 // DOS error
1784 int n = (int)FormatMessage( 1781 size_t n = (size_t)FormatMessage(
1785 FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, 1782 FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
1786 NULL, 1783 NULL,
1787 errval, 1784 errval,
1788 0, 1785 0,
1789 buf, 1786 buf,
1790 (DWORD)len, 1787 (DWORD)len,
1791 NULL); 1788 NULL);
1792 if (n > 3) { 1789 if (n > 3) {
1793 /* Drop final '.', CR, LF */ 1790 // Drop final '.', CR, LF
1794 if (buf[n - 1] == '\n') n--; 1791 if (buf[n - 1] == '\n') n--;
1795 if (buf[n - 1] == '\r') n--; 1792 if (buf[n - 1] == '\r') n--;
1796 if (buf[n - 1] == '.') n--; 1793 if (buf[n - 1] == '.') n--;
1797 buf[n] = '\0'; 1794 buf[n] = '\0';
1798 } 1795 }
1799 return n; 1796 return n;
1800 } 1797 }
1801 1798
1802 if (errno != 0) { 1799 if (errno != 0) {
1803 /* C runtime error that has no corresponding DOS error code */ 1800 // C runtime error that has no corresponding DOS error code
1804 const char *s = strerror(errno); 1801 const char* s = strerror(errno);
1805 size_t n = strlen(s); 1802 size_t n = strlen(s);
1806 if (n >= len) n = len - 1; 1803 if (n >= len) n = len - 1;
1807 strncpy(buf, s, n); 1804 strncpy(buf, s, n);
1808 buf[n] = '\0'; 1805 buf[n] = '\0';
1809 return n; 1806 return n;
1810 } 1807 }
1808
1811 return 0; 1809 return 0;
1810 }
1811
1812 int os::get_last_error() {
1813 DWORD error = GetLastError();
1814 if (error == 0)
1815 error = errno;
1816 return (int)error;
1812 } 1817 }
1813 1818
1814 // sun.misc.Signal 1819 // sun.misc.Signal
1815 // NOTE that this is a workaround for an apparent kernel bug where if 1820 // NOTE that this is a workaround for an apparent kernel bug where if
1816 // a signal handler for SIGBREAK is installed then that signal handler 1821 // a signal handler for SIGBREAK is installed then that signal handler
2080 #ifdef _M_IA64 2085 #ifdef _M_IA64
2081 assert(0, "Fix Handle_IDiv_Exception"); 2086 assert(0, "Fix Handle_IDiv_Exception");
2082 #elif _M_AMD64 2087 #elif _M_AMD64
2083 PCONTEXT ctx = exceptionInfo->ContextRecord; 2088 PCONTEXT ctx = exceptionInfo->ContextRecord;
2084 address pc = (address)ctx->Rip; 2089 address pc = (address)ctx->Rip;
2085 NOT_PRODUCT(Events::log("idiv overflow exception at " INTPTR_FORMAT , pc));
2086 //assert(pc[0] == 0xF7 || (pc[1] == 0xF7 && (pc[0] == 0x41 || pc[0] == 0x49)), "not an idiv opcode"); 2090 //assert(pc[0] == 0xF7 || (pc[1] == 0xF7 && (pc[0] == 0x41 || pc[0] == 0x49)), "not an idiv opcode");
2087 //assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); 2091 //assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands");
2088 //assert((long)ctx->Rax == (long)min_jint || pc[0] == 0x49, "unexpected idiv exception"); 2092 //assert((long)ctx->Rax == (long)min_jint || pc[0] == 0x49, "unexpected idiv exception");
2089 // set correct result values and continue after idiv instruction 2093 // set correct result values and continue after idiv instruction
2090 ctx->Rip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes 2094 ctx->Rip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes
2092 ctx->Rdx = (DWORD)0; // remainder 2096 ctx->Rdx = (DWORD)0; // remainder
2093 // Continue the execution 2097 // Continue the execution
2094 #else 2098 #else
2095 PCONTEXT ctx = exceptionInfo->ContextRecord; 2099 PCONTEXT ctx = exceptionInfo->ContextRecord;
2096 address pc = (address)ctx->Eip; 2100 address pc = (address)ctx->Eip;
2097 NOT_PRODUCT(Events::log("idiv overflow exception at " INTPTR_FORMAT , pc));
2098 assert(pc[0] == 0xF7, "not an idiv opcode"); 2101 assert(pc[0] == 0xF7, "not an idiv opcode");
2099 assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); 2102 assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands");
2100 assert(ctx->Eax == min_jint, "unexpected idiv exception"); 2103 assert(ctx->Eax == min_jint, "unexpected idiv exception");
2101 // set correct result values and continue after idiv instruction 2104 // set correct result values and continue after idiv instruction
2102 ctx->Eip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes 2105 ctx->Eip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes
3129 DWORD old_status; 3132 DWORD old_status;
3130 return VirtualProtect(addr, bytes, PAGE_READWRITE, &old_status) != 0; 3133 return VirtualProtect(addr, bytes, PAGE_READWRITE, &old_status) != 0;
3131 } 3134 }
3132 3135
3133 void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { } 3136 void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { }
3134 void os::free_memory(char *addr, size_t bytes) { } 3137 void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) { }
3135 void os::numa_make_global(char *addr, size_t bytes) { } 3138 void os::numa_make_global(char *addr, size_t bytes) { }
3136 void os::numa_make_local(char *addr, size_t bytes, int lgrp_hint) { } 3139 void os::numa_make_local(char *addr, size_t bytes, int lgrp_hint) { }
3137 bool os::numa_topology_changed() { return false; } 3140 bool os::numa_topology_changed() { return false; }
3138 size_t os::numa_get_groups_num() { return MAX2(numa_node_list_holder.get_count(), 1); } 3141 size_t os::numa_get_groups_num() { return MAX2(numa_node_list_holder.get_count(), 1); }
3139 int os::numa_get_group_id() { return 0; } 3142 int os::numa_get_group_id() { return 0; }
3288 3291
3289 // Win32 only gives you access to seven real priorities at a time, 3292 // Win32 only gives you access to seven real priorities at a time,
3290 // so we compress Java's ten down to seven. It would be better 3293 // so we compress Java's ten down to seven. It would be better
3291 // if we dynamically adjusted relative priorities. 3294 // if we dynamically adjusted relative priorities.
3292 3295
3293 int os::java_to_os_priority[MaxPriority + 1] = { 3296 int os::java_to_os_priority[CriticalPriority + 1] = {
3294 THREAD_PRIORITY_IDLE, // 0 Entry should never be used 3297 THREAD_PRIORITY_IDLE, // 0 Entry should never be used
3295 THREAD_PRIORITY_LOWEST, // 1 MinPriority 3298 THREAD_PRIORITY_LOWEST, // 1 MinPriority
3296 THREAD_PRIORITY_LOWEST, // 2 3299 THREAD_PRIORITY_LOWEST, // 2
3297 THREAD_PRIORITY_BELOW_NORMAL, // 3 3300 THREAD_PRIORITY_BELOW_NORMAL, // 3
3298 THREAD_PRIORITY_BELOW_NORMAL, // 4 3301 THREAD_PRIORITY_BELOW_NORMAL, // 4
3299 THREAD_PRIORITY_NORMAL, // 5 NormPriority 3302 THREAD_PRIORITY_NORMAL, // 5 NormPriority
3300 THREAD_PRIORITY_NORMAL, // 6 3303 THREAD_PRIORITY_NORMAL, // 6
3301 THREAD_PRIORITY_ABOVE_NORMAL, // 7 3304 THREAD_PRIORITY_ABOVE_NORMAL, // 7
3302 THREAD_PRIORITY_ABOVE_NORMAL, // 8 3305 THREAD_PRIORITY_ABOVE_NORMAL, // 8
3303 THREAD_PRIORITY_HIGHEST, // 9 NearMaxPriority 3306 THREAD_PRIORITY_HIGHEST, // 9 NearMaxPriority
3304 THREAD_PRIORITY_HIGHEST // 10 MaxPriority 3307 THREAD_PRIORITY_HIGHEST, // 10 MaxPriority
3308 THREAD_PRIORITY_HIGHEST // 11 CriticalPriority
3305 }; 3309 };
3306 3310
3307 int prio_policy1[MaxPriority + 1] = { 3311 int prio_policy1[CriticalPriority + 1] = {
3308 THREAD_PRIORITY_IDLE, // 0 Entry should never be used 3312 THREAD_PRIORITY_IDLE, // 0 Entry should never be used
3309 THREAD_PRIORITY_LOWEST, // 1 MinPriority 3313 THREAD_PRIORITY_LOWEST, // 1 MinPriority
3310 THREAD_PRIORITY_LOWEST, // 2 3314 THREAD_PRIORITY_LOWEST, // 2
3311 THREAD_PRIORITY_BELOW_NORMAL, // 3 3315 THREAD_PRIORITY_BELOW_NORMAL, // 3
3312 THREAD_PRIORITY_BELOW_NORMAL, // 4 3316 THREAD_PRIORITY_BELOW_NORMAL, // 4
3313 THREAD_PRIORITY_NORMAL, // 5 NormPriority 3317 THREAD_PRIORITY_NORMAL, // 5 NormPriority
3314 THREAD_PRIORITY_ABOVE_NORMAL, // 6 3318 THREAD_PRIORITY_ABOVE_NORMAL, // 6
3315 THREAD_PRIORITY_ABOVE_NORMAL, // 7 3319 THREAD_PRIORITY_ABOVE_NORMAL, // 7
3316 THREAD_PRIORITY_HIGHEST, // 8 3320 THREAD_PRIORITY_HIGHEST, // 8
3317 THREAD_PRIORITY_HIGHEST, // 9 NearMaxPriority 3321 THREAD_PRIORITY_HIGHEST, // 9 NearMaxPriority
3318 THREAD_PRIORITY_TIME_CRITICAL // 10 MaxPriority 3322 THREAD_PRIORITY_TIME_CRITICAL, // 10 MaxPriority
3323 THREAD_PRIORITY_TIME_CRITICAL // 11 CriticalPriority
3319 }; 3324 };
3320 3325
3321 static int prio_init() { 3326 static int prio_init() {
3322 // If ThreadPriorityPolicy is 1, switch tables 3327 // If ThreadPriorityPolicy is 1, switch tables
3323 if (ThreadPriorityPolicy == 1) { 3328 if (ThreadPriorityPolicy == 1) {
3324 int i; 3329 int i;
3325 for (i = 0; i < MaxPriority + 1; i++) { 3330 for (i = 0; i < CriticalPriority + 1; i++) {
3326 os::java_to_os_priority[i] = prio_policy1[i]; 3331 os::java_to_os_priority[i] = prio_policy1[i];
3327 } 3332 }
3333 }
3334 if (UseCriticalJavaThreadPriority) {
3335 os::java_to_os_priority[MaxPriority] = os::java_to_os_priority[CriticalPriority] ;
3328 } 3336 }
3329 return 0; 3337 return 0;
3330 } 3338 }
3331 3339
3332 OSReturn os::set_native_priority(Thread* thread, int priority) { 3340 OSReturn os::set_native_priority(Thread* thread, int priority) {
4745 tty->print_cr("C heap has been corrupted (time: %d allocations)", mallocDebugCounter); 4753 tty->print_cr("C heap has been corrupted (time: %d allocations)", mallocDebugCounter);
4746 tty->print_cr("corrupted block near address %#x, length %d", phe.lpData, phe.cbData); 4754 tty->print_cr("corrupted block near address %#x, length %d", phe.lpData, phe.cbData);
4747 fatal("corrupted C heap"); 4755 fatal("corrupted C heap");
4748 } 4756 }
4749 } 4757 }
4750 int err = GetLastError(); 4758 DWORD err = GetLastError();
4751 if (err != ERROR_NO_MORE_ITEMS && err != ERROR_CALL_NOT_IMPLEMENTED) { 4759 if (err != ERROR_NO_MORE_ITEMS && err != ERROR_CALL_NOT_IMPLEMENTED) {
4752 fatal(err_msg("heap walk aborted with error %d", err)); 4760 fatal(err_msg("heap walk aborted with error %d", err));
4753 } 4761 }
4754 HeapUnlock(heap); 4762 HeapUnlock(heap);
4755 } 4763 }
4776 return EXCEPTION_CONTINUE_EXECUTION; 4784 return EXCEPTION_CONTINUE_EXECUTION;
4777 } 4785 }
4778 4786
4779 return EXCEPTION_CONTINUE_SEARCH; 4787 return EXCEPTION_CONTINUE_SEARCH;
4780 } 4788 }
4781
4782 static int getLastErrorString(char *buf, size_t len)
4783 {
4784 long errval;
4785
4786 if ((errval = GetLastError()) != 0)
4787 {
4788 /* DOS error */
4789 size_t n = (size_t)FormatMessage(
4790 FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
4791 NULL,
4792 errval,
4793 0,
4794 buf,
4795 (DWORD)len,
4796 NULL);
4797 if (n > 3) {
4798 /* Drop final '.', CR, LF */
4799 if (buf[n - 1] == '\n') n--;
4800 if (buf[n - 1] == '\r') n--;
4801 if (buf[n - 1] == '.') n--;
4802 buf[n] = '\0';
4803 }
4804 return (int)n;
4805 }
4806
4807 if (errno != 0)
4808 {
4809 /* C runtime error that has no corresponding DOS error code */
4810 const char *s = strerror(errno);
4811 size_t n = strlen(s);
4812 if (n >= len) n = len - 1;
4813 strncpy(buf, s, n);
4814 buf[n] = '\0';
4815 return (int)n;
4816 }
4817 return 0;
4818 }
4819
4820 4789
4821 // We don't build a headless jre for Windows 4790 // We don't build a headless jre for Windows
4822 bool os::is_headless_jre() { return false; } 4791 bool os::is_headless_jre() { return false; }
4823 4792
4824 4793
4848 } 4817 }
4849 sock_initialized = TRUE; 4818 sock_initialized = TRUE;
4850 ::mutexUnlock(&sockFnTableMutex); 4819 ::mutexUnlock(&sockFnTableMutex);
4851 } 4820 }
4852 4821
4853 struct hostent* os::get_host_by_name(char* name) { 4822 struct hostent* os::get_host_by_name(char* name) {
4854 if (!sock_initialized) { 4823 if (!sock_initialized) {
4855 initSock(); 4824 initSock();
4856 } 4825 }
4857 if (!os::WinSock2Dll::WinSock2Available()) { 4826 if (!os::WinSock2Dll::WinSock2Available()) {
4858 return NULL; 4827 return NULL;
4879 int os::listen(int fd, int count) { 4848 int os::listen(int fd, int count) {
4880 ShouldNotReachHere(); 4849 ShouldNotReachHere();
4881 return 0; 4850 return 0;
4882 } 4851 }
4883 4852
4884 int os::connect(int fd, struct sockaddr *him, int len) { 4853 int os::connect(int fd, struct sockaddr* him, socklen_t len) {
4885 ShouldNotReachHere(); 4854 ShouldNotReachHere();
4886 return 0; 4855 return 0;
4887 } 4856 }
4888 4857
4889 int os::accept(int fd, struct sockaddr *him, int *len) { 4858 int os::accept(int fd, struct sockaddr* him, socklen_t* len) {
4890 ShouldNotReachHere(); 4859 ShouldNotReachHere();
4891 return 0; 4860 return 0;
4892 } 4861 }
4893 4862
4894 int os::sendto(int fd, char *buf, int len, int flags, 4863 int os::sendto(int fd, char* buf, size_t len, uint flags,
4895 struct sockaddr *to, int tolen) { 4864 struct sockaddr* to, socklen_t tolen) {
4896 ShouldNotReachHere(); 4865 ShouldNotReachHere();
4897 return 0; 4866 return 0;
4898 } 4867 }
4899 4868
4900 int os::recvfrom(int fd, char *buf, int nBytes, int flags, 4869 int os::recvfrom(int fd, char *buf, size_t nBytes, uint flags,
4901 sockaddr *from, int *fromlen) { 4870 sockaddr* from, socklen_t* fromlen) {
4902 ShouldNotReachHere(); 4871 ShouldNotReachHere();
4903 return 0; 4872 return 0;
4904 } 4873 }
4905 4874
4906 int os::recv(int fd, char *buf, int nBytes, int flags) { 4875 int os::recv(int fd, char* buf, size_t nBytes, uint flags) {
4907 ShouldNotReachHere(); 4876 ShouldNotReachHere();
4908 return 0; 4877 return 0;
4909 } 4878 }
4910 4879
4911 int os::send(int fd, char *buf, int nBytes, int flags) { 4880 int os::send(int fd, char* buf, size_t nBytes, uint flags) {
4912 ShouldNotReachHere(); 4881 ShouldNotReachHere();
4913 return 0; 4882 return 0;
4914 } 4883 }
4915 4884
4916 int os::raw_send(int fd, char *buf, int nBytes, int flags) { 4885 int os::raw_send(int fd, char* buf, size_t nBytes, uint flags) {
4917 ShouldNotReachHere(); 4886 ShouldNotReachHere();
4918 return 0; 4887 return 0;
4919 } 4888 }
4920 4889
4921 int os::timeout(int fd, long timeout) { 4890 int os::timeout(int fd, long timeout) {
4931 int os::socket_shutdown(int fd, int howto) { 4900 int os::socket_shutdown(int fd, int howto) {
4932 ShouldNotReachHere(); 4901 ShouldNotReachHere();
4933 return 0; 4902 return 0;
4934 } 4903 }
4935 4904
4936 int os::bind(int fd, struct sockaddr *him, int len) { 4905 int os::bind(int fd, struct sockaddr* him, socklen_t len) {
4937 ShouldNotReachHere(); 4906 ShouldNotReachHere();
4938 return 0; 4907 return 0;
4939 } 4908 }
4940 4909
4941 int os::get_sock_name(int fd, struct sockaddr *him, int *len) { 4910 int os::get_sock_name(int fd, struct sockaddr* him, socklen_t* len) {
4942 ShouldNotReachHere(); 4911 ShouldNotReachHere();
4943 return 0; 4912 return 0;
4944 } 4913 }
4945 4914
4946 int os::get_sock_opt(int fd, int level, int optname, 4915 int os::get_sock_opt(int fd, int level, int optname,
4947 char *optval, int* optlen) { 4916 char* optval, socklen_t* optlen) {
4948 ShouldNotReachHere(); 4917 ShouldNotReachHere();
4949 return 0; 4918 return 0;
4950 } 4919 }
4951 4920
4952 int os::set_sock_opt(int fd, int level, int optname, 4921 int os::set_sock_opt(int fd, int level, int optname,
4953 const char *optval, int optlen) { 4922 const char* optval, socklen_t optlen) {
4954 ShouldNotReachHere(); 4923 ShouldNotReachHere();
4955 return 0; 4924 return 0;
4956 } 4925 }
4957 4926
4958 4927
5362 _OpenProcessToken != NULL && 5331 _OpenProcessToken != NULL &&
5363 _LookupPrivilegeValue != NULL; 5332 _LookupPrivilegeValue != NULL;
5364 } 5333 }
5365 5334
5366 #endif 5335 #endif
5367