From: Bruce Cran Date: Fri, 8 Jun 2012 06:12:20 +0000 (+0200) Subject: Windows 32-bit fio fixes X-Git-Tag: fio-2.0.9~19 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=d39879467ccb7f136815be0ba7fd283524c2dafb Windows 32-bit fio fixes Fix no-op shift in shmget by casting to 64-bit. Generate a new Product GUID for fio 2.0.8. Add the 32-bit MinGW-w64 compiler executable name in Makefile. Signed-off-by: Jens Axboe --- diff --git a/Makefile b/Makefile index f72bf8e2..6a41710b 100644 --- a/Makefile +++ b/Makefile @@ -61,6 +61,7 @@ ifneq (,$(findstring CYGWIN,$(UNAME))) LIBS += -lpthread -lpsapi -lws2_32 CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format CC = x86_64-w64-mingw32-gcc + #CC = i686-w64-mingw32-gcc endif OBJS = $(SOURCE:.c=.o) diff --git a/os/windows/install.wxs b/os/windows/install.wxs index 5bea45c5..f8da8fc0 100755 --- a/os/windows/install.wxs +++ b/os/windows/install.wxs @@ -7,7 +7,7 @@ - diff --git a/os/windows/posix.c b/os/windows/posix.c index 9ef369e1..41bcb2d4 100755 --- a/os/windows/posix.c +++ b/os/windows/posix.c @@ -393,7 +393,9 @@ HANDLE fileMappings[1024]; int shmget(key_t key, size_t size, int shmflg) { int mapid = -1; - HANDLE hMapping = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, (PAGE_EXECUTE_READWRITE | SEC_RESERVE), size >> 32, size & 0xFFFFFFFF, NULL); + uint32_t size_low = size & 0xFFFFFFFF; + uint32_t size_high = ((uint64_t)size) >> 32; + HANDLE hMapping = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, (PAGE_EXECUTE_READWRITE | SEC_RESERVE), size_high, size_low, NULL); if (hMapping != NULL) { fileMappings[nFileMappings] = hMapping; mapid = nFileMappings;