Changeset 320 for trunk/openjdk/hotspot/src/os/windows/vm/os_windows.cpp
- Timestamp:
- Feb 16, 2012, 3:07:55 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/openjdk/hotspot/src/os/windows/vm/os_windows.cpp
r315 r320 26 26 // Must be at least Windows 2000 or XP to use VectoredExceptions 27 27 #define _WIN32_WINNT 0x500 28 #endif 29 30 #ifdef __WIN32OS2__ 31 #include <os2wrap2.h> 28 32 #endif 29 33 … … 104 108 #include <vdmdbg.h> 105 109 110 #ifdef __EMX__ 111 106 112 #ifdef __WIN32OS2__ 107 113 #include <mmsystem.h> 108 114 #include <wincon.h> 109 115 #include <basetsd.h> 116 #include <winsock.h> 110 117 #define _M_IX86 118 #endif 119 120 #define _stati64 stat 121 #define _fstati64 fstat 111 122 #define _lseeki64 lseek 112 #endif 123 124 #endif /* EMX */ 113 125 114 126 // for timer info max values which include all bits … … 4033 4045 #ifdef DEBUG 4034 4046 jio_fprintf(stderr, "sysNativePath: %s\n", path); 4035 #endif DEBUG4047 #endif 4036 4048 return path; 4037 4049 } … … 4041 4053 4042 4054 int os::ftruncate(int fd, jlong length) { 4043 HANDLE h = (HANDLE)::_get_osfhandle(fd); 4044 long high = (long)(length >> 32); 4045 DWORD ret; 4046 4047 if (h == (HANDLE)(-1)) { 4048 return -1; 4049 } 4050 4051 ret = ::SetFilePointer(h, (long)(length), &high, FILE_BEGIN); 4052 if ((ret == 0xFFFFFFFF) && (::GetLastError() != NO_ERROR)) { 4055 #ifdef __EMX__ 4056 return ftruncate(fd, length); 4057 #else /* __EMX__ */ 4058 HANDLE h = (HANDLE)::_get_osfhandle(fd); 4059 long high = (long)(length >> 32); 4060 DWORD ret; 4061 4062 if (h == (HANDLE)(-1)) { 4053 4063 return -1; 4054 } 4055 4056 if (::SetEndOfFile(h) == FALSE) { 4057 return -1; 4058 } 4059 4060 return 0; 4064 } 4065 4066 ret = ::SetFilePointer(h, (long)(length), &high, FILE_BEGIN); 4067 if ((ret == 0xFFFFFFFF) && (::GetLastError() != NO_ERROR)) { 4068 return -1; 4069 } 4070 4071 if (::SetEndOfFile(h) == FALSE) { 4072 return -1; 4073 } 4074 4075 return 0; 4076 #endif /* __EMX__ */ 4061 4077 } 4062 4078 … … 4067 4083 4068 4084 int os::fsync(int fd) { 4085 #ifdef __EMX__ 4086 return fsync(fd); 4087 #else /* __EMX__ */ 4069 4088 HANDLE handle = (HANDLE)::_get_osfhandle(fd); 4070 4089 … … 4075 4094 } 4076 4095 return 0; 4096 #endif /* __EMX__ */ 4077 4097 } 4078 4098 … … 4080 4100 static int stdinAvailable(int, long *); 4081 4101 4102 #ifndef S_ISCHR 4082 4103 #define S_ISCHR(mode) (((mode) & _S_IFCHR) == _S_IFCHR) 4104 #endif 4105 #ifndef S_ISFIFO 4083 4106 #define S_ISFIFO(mode) (((mode) & _S_IFIFO) == _S_IFIFO) 4107 #endif 4084 4108 4085 4109 // This code is a copy of JDK's sysAvailable … … 4127 4151 * 4128 4152 */ 4153 #ifdef __WIN32OS2__ 4154 os2_AVAILDATA avail = { 0, 0 }; 4155 os2_ULONG pipeState; 4156 os2_APIRET arc = DosPeekNPipe(0, NULL, 0, NULL, &avail, &pipeState); 4157 // note that even if ERROR_INVALID_PARAMETER, it seems to return the 4158 // correct values in avail and state (undocumented) 4159 if (arc != NO_ERROR && arc != ERROR_INVALID_PARAMETER) { 4160 *pbytes = avail.cbpipe; 4161 return TRUE; 4162 } 4163 4164 return FALSE; 4165 #else 4129 4166 HANDLE han; 4130 4167 … … 4146 4183 } 4147 4184 return TRUE; 4185 #endif 4148 4186 } 4149 4187 … … 4763 4801 4764 4802 static void initSockFnTable() { 4765 int ( PASCAL FAR* WSAStartupPtr)(WORD, LPWSADATA);4803 int (FAR PASCAL * WSAStartupPtr)(WORD, LPWSADATA); 4766 4804 WSADATA wsadata; 4767 4805 … … 4782 4820 4783 4821 /* If we loaded a DLL, then we might as well initialize it. */ 4784 WSAStartupPtr = (int ( PASCAL FAR*)(WORD, LPWSADATA))4822 WSAStartupPtr = (int (FAR PASCAL *)(WORD, LPWSADATA)) 4785 4823 ::GetProcAddress(hWinsock, "WSAStartup"); 4786 4824
Note: See TracChangeset
for help on using the changeset viewer.