Changeset 76919 in vbox for trunk/src/VBox/ValidationKit/utils
- Timestamp:
- Jan 21, 2019 1:25:31 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp
r76918 r76919 53 53 #ifdef RT_OS_WINDOWS 54 54 # include <iprt/nt/nt-and-windows.h> 55 #else 56 # include <errno.h> 57 # include <unistd.h> 58 # include <sys/fcntl.h> 59 # include <sys/mman.h> 60 # include <sys/types.h> 55 61 #endif 56 62 … … 1873 1879 RTTESTI_CHECK(Ios.Status == STATUS_END_OF_FILE); 1874 1880 RTTESTI_CHECK(Ios.Information == 0); 1881 #else 1882 ssize_t cbRead = read((int)RTFileToNative(hFile1), pbBuf, 0); 1883 RTTESTI_CHECK(cbRead == 0); 1875 1884 #endif 1876 1885 … … 2053 2062 RTTESTI_CHECK(Ios.Status == STATUS_SUCCESS); 2054 2063 RTTESTI_CHECK(Ios.Information == 0); 2055 2064 #else 2065 ssize_t cbWritten = write((int)RTFileToNative(hFile1), pbBuf, 0); 2066 RTTESTI_CHECK(cbWritten == 0); 2067 #endif 2056 2068 RTTESTI_CHECK_RC(RTFileRead(hFile1, pbBuf, _4K, NULL), VINF_SUCCESS); 2057 2069 fsPerfCheckReadBuf(__LINE__, cbFile - _4K, pbBuf, _4K, pbBuf[0x8]); 2058 #endif2059 2070 2060 2071 /* … … 2127 2138 { 2128 2139 RTTestISub("mmap"); 2129 #if defined(RT_OS_WINDOWS) 2140 #if defined(RT_OS_WINDOWS) || defined(RT_OS_LINUX) 2130 2141 static const char * const s_apszStates[] = { "readonly", "writecopy", "readwrite" }; 2131 2142 enum { kMMap_ReadOnly = 0, kMMap_WriteCopy, kMMap_ReadWrite, kMMap_End }; … … 2174 2185 enmState == kMMap_ReadOnly ? PROT_READ : PROT_READ | PROT_WRITE, 2175 2186 enmState == kMMap_WriteCopy ? MAP_PRIVATE : MAP_SHARED, 2176 (int)RTFileToNative(hFile1), cbMapping);2187 (int)RTFileToNative(hFile1), 0); 2177 2188 if ((void *)pbMapping != MAP_FAILED) 2178 2189 break; … … 2226 2237 continue; 2227 2238 2239 # if defined(RT_OS_LINUX) 2240 size_t const cFlushes = RT_MIN(cbMapping / cbFlush, 2048); 2241 # else 2228 2242 size_t const cFlushes = cbMapping / cbFlush; 2243 # endif 2229 2244 uint8_t *pbCur = pbMapping; 2230 2245 ns = RTTimeNanoTS();
Note:
See TracChangeset
for help on using the changeset viewer.