VirtualBox

Ignore:
Timestamp:
Jan 21, 2019 1:25:31 PM (6 years ago)
Author:
vboxsync
Message:

FsPerf: Linux updates. bugref:9172

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp

    r76918 r76919  
    5353#ifdef RT_OS_WINDOWS
    5454# 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>
    5561#endif
    5662
     
    18731879    RTTESTI_CHECK(Ios.Status == STATUS_END_OF_FILE);
    18741880    RTTESTI_CHECK(Ios.Information == 0);
     1881#else
     1882    ssize_t cbRead = read((int)RTFileToNative(hFile1), pbBuf, 0);
     1883    RTTESTI_CHECK(cbRead == 0);
    18751884#endif
    18761885
     
    20532062    RTTESTI_CHECK(Ios.Status == STATUS_SUCCESS);
    20542063    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
    20562068    RTTESTI_CHECK_RC(RTFileRead(hFile1, pbBuf, _4K, NULL), VINF_SUCCESS);
    20572069    fsPerfCheckReadBuf(__LINE__, cbFile - _4K, pbBuf, _4K, pbBuf[0x8]);
    2058 #endif
    20592070
    20602071    /*
     
    21272138{
    21282139    RTTestISub("mmap");
    2129 #if defined(RT_OS_WINDOWS)
     2140#if defined(RT_OS_WINDOWS) || defined(RT_OS_LINUX)
    21302141    static const char * const s_apszStates[] = { "readonly", "writecopy", "readwrite" };
    21312142    enum { kMMap_ReadOnly = 0, kMMap_WriteCopy, kMMap_ReadWrite, kMMap_End };
     
    21742185                                        enmState == kMMap_ReadOnly  ? PROT_READ   : PROT_READ | PROT_WRITE,
    21752186                                        enmState == kMMap_WriteCopy ? MAP_PRIVATE : MAP_SHARED,
    2176                                         (int)RTFileToNative(hFile1), cbMapping);
     2187                                        (int)RTFileToNative(hFile1), 0);
    21772188            if ((void *)pbMapping != MAP_FAILED)
    21782189                break;
     
    22262237                        continue;
    22272238
     2239# if defined(RT_OS_LINUX)
     2240                    size_t const cFlushes = RT_MIN(cbMapping / cbFlush, 2048);
     2241# else
    22282242                    size_t const cFlushes = cbMapping / cbFlush;
     2243# endif
    22292244                    uint8_t     *pbCur    = pbMapping;
    22302245                    ns = RTTimeNanoTS();
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette