From 26dcc08452b18f72e404760d8dc3c0bc057dacbe Mon Sep 17 00:00:00 2001 From: Sitsofe Wheeler Date: Wed, 23 Dec 2020 16:01:52 +0000 Subject: [PATCH] windows: drop XP support Windows 2003 has been EOL since 2015 and Windows XP has been EOL since 2014. Technically fio hasn't been properly targetting XP anyway - (see 16d40a15783f9181d64082fc00a970dff485798f 'configure: be explicit about "XP" Windows API version'). - Strip out support for XP and change the documentation to no longer mention it - Stop targetting XP in the CI 32 bit build Next stop, Windows 7... Signed-off-by: Sitsofe Wheeler --- .appveyor.yml | 2 +- README | 9 ++- configure | 8 +-- os/os-windows-xp.h | 3 - os/os-windows.h | 6 +- os/windows/cpu-affinity.c | 73 ----------------------- os/windows/posix.c | 87 ---------------------------- os/windows/posix/include/arpa/inet.h | 6 -- os/windows/posix/include/poll.h | 14 ----- 9 files changed, 8 insertions(+), 200 deletions(-) delete mode 100644 os/os-windows-xp.h diff --git a/.appveyor.yml b/.appveyor.yml index fad16326..42b79958 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -19,7 +19,7 @@ environment: CONFIGURE_OPTIONS: DISTRO: cygwin - ARCHITECTURE: x86 - CONFIGURE_OPTIONS: --build-32bit-win --target-win-ver=xp + CONFIGURE_OPTIONS: --build-32bit-win DISTRO: cygwin install: diff --git a/README b/README index 0f943bcc..2fecf0e0 100644 --- a/README +++ b/README @@ -164,8 +164,9 @@ configure. Windows ~~~~~~~ -On Windows, Cygwin (https://www.cygwin.com/) is required in order to build -fio. To create an MSI installer package install WiX from +The minimum versions of Windows for building/runing fio are Windows 7/Windows +Server 2008 R2. On Windows, Cygwin (https://www.cygwin.com/) is required in +order to build fio. To create an MSI installer package install WiX from https://wixtoolset.org and run :file:`dobuild.cmd` from the :file:`os/windows` directory. @@ -181,9 +182,7 @@ How to compile fio on 64-bit Windows: To build fio for 32-bit Windows, ensure the -i686 versions of the previously mentioned -x86_64 packages are installed and run ``./configure ---build-32bit-win`` before ``make``. To build an fio that supports versions of -Windows below Windows 7/Windows Server 2008 R2 also add ``--target-win-ver=xp`` -to the end of the configure line that you run before doing ``make``. +--build-32bit-win`` before ``make``. It's recommended that once built or installed, fio be run in a Command Prompt or other 'native' console such as console2, since there are known to be display and diff --git a/configure b/configure index d247a041..e3e37d56 100755 --- a/configure +++ b/configure @@ -257,7 +257,7 @@ if test "$show_help" = "yes" ; then echo "--cc= Specify compiler to use" echo "--extra-cflags= Specify extra CFLAGS to pass to compiler" echo "--build-32bit-win Enable 32-bit build on Windows" - echo "--target-win-ver= Minimum version of Windows to target (XP or 7)" + echo "--target-win-ver= Minimum version of Windows to target (only accepts 7)" echo "--enable-pdb Enable Windows PDB symbols generation (needs clang/lld)" echo "--build-static Build a static fio" echo "--esx Configure build options for esx" @@ -395,11 +395,7 @@ CYGWIN*) # Default Windows API target target_win_ver="7" fi - if test "$target_win_ver" = "XP"; then - output_sym "CONFIG_WINDOWS_XP" - # Technically the below is targeting 2003 - CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0502" - elif test "$target_win_ver" = "7"; then + if test "$target_win_ver" = "7"; then output_sym "CONFIG_WINDOWS_7" CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601" else diff --git a/os/os-windows-xp.h b/os/os-windows-xp.h deleted file mode 100644 index fbc23e2c..00000000 --- a/os/os-windows-xp.h +++ /dev/null @@ -1,3 +0,0 @@ -#define FIO_MAX_CPUS MAXIMUM_PROCESSORS - -typedef DWORD_PTR os_cpu_mask_t; diff --git a/os/os-windows.h b/os/os-windows.h index fa2955f9..ddfae413 100644 --- a/os/os-windows.h +++ b/os/os-windows.h @@ -21,6 +21,7 @@ #include "../lib/types.h" #include "windows/posix.h" +#include "os-windows-7.h" #ifndef PTHREAD_STACK_MIN #define PTHREAD_STACK_MIN 65535 @@ -215,13 +216,8 @@ static inline int fio_mkdir(const char *path, mode_t mode) { return 0; } -#ifdef CONFIG_WINDOWS_XP -#include "os-windows-xp.h" -#else #define FIO_HAVE_CPU_ONLINE_SYSCONF unsigned int cpus_online(void); -#include "os-windows-7.h" -#endif int first_set_cpu(os_cpu_mask_t *cpumask); int fio_setaffinity(int pid, os_cpu_mask_t cpumask); diff --git a/os/windows/cpu-affinity.c b/os/windows/cpu-affinity.c index 46fd048d..7601970f 100644 --- a/os/windows/cpu-affinity.c +++ b/os/windows/cpu-affinity.c @@ -2,78 +2,6 @@ #include -#ifdef CONFIG_WINDOWS_XP -int fio_setaffinity(int pid, os_cpu_mask_t cpumask) -{ - HANDLE h; - BOOL bSuccess = FALSE; - - h = OpenThread(THREAD_QUERY_INFORMATION | THREAD_SET_INFORMATION, TRUE, - pid); - if (h != NULL) { - bSuccess = SetThreadAffinityMask(h, cpumask); - if (!bSuccess) - log_err("fio_setaffinity failed: failed to set thread affinity (pid %d, mask %.16llx)\n", - pid, (long long unsigned) cpumask); - - CloseHandle(h); - } else { - log_err("fio_setaffinity failed: failed to get handle for pid %d\n", - pid); - } - - return bSuccess ? 0 : -1; -} - -int fio_getaffinity(int pid, os_cpu_mask_t *mask) -{ - os_cpu_mask_t systemMask; - - HANDLE h = OpenProcess(PROCESS_QUERY_INFORMATION, TRUE, pid); - - if (h != NULL) { - GetProcessAffinityMask(h, mask, &systemMask); - CloseHandle(h); - } else { - log_err("fio_getaffinity failed: failed to get handle for pid %d\n", - pid); - return -1; - } - - return 0; -} - -void fio_cpu_clear(os_cpu_mask_t *mask, int cpu) -{ - *mask &= ~(1ULL << cpu); -} - -void fio_cpu_set(os_cpu_mask_t *mask, int cpu) -{ - *mask |= 1ULL << cpu; -} - -int fio_cpu_isset(os_cpu_mask_t *mask, int cpu) -{ - return (*mask & (1ULL << cpu)) != 0; -} - -int fio_cpu_count(os_cpu_mask_t *mask) -{ - return hweight64(*mask); -} - -int fio_cpuset_init(os_cpu_mask_t *mask) -{ - *mask = 0; - return 0; -} - -int fio_cpuset_exit(os_cpu_mask_t *mask) -{ - return 0; -} -#else /* CONFIG_WINDOWS_XP */ /* Return all processors regardless of processor group */ unsigned int cpus_online(void) { @@ -443,4 +371,3 @@ int fio_cpuset_exit(os_cpu_mask_t *mask) { return 0; } -#endif /* CONFIG_WINDOWS_XP */ diff --git a/os/windows/posix.c b/os/windows/posix.c index 9e9f12ef..09c2e4a7 100644 --- a/os/windows/posix.c +++ b/os/windows/posix.c @@ -1026,90 +1026,3 @@ in_addr_t inet_network(const char *cp) hbo = ((nbo & 0xFF) << 24) + ((nbo & 0xFF00) << 8) + ((nbo & 0xFF0000) >> 8) + ((nbo & 0xFF000000) >> 24); return hbo; } - -#ifdef CONFIG_WINDOWS_XP -const char *inet_ntop(int af, const void *restrict src, char *restrict dst, - socklen_t size) -{ - INT status = SOCKET_ERROR; - WSADATA wsd; - char *ret = NULL; - - if (af != AF_INET && af != AF_INET6) { - errno = EAFNOSUPPORT; - return NULL; - } - - WSAStartup(MAKEWORD(2,2), &wsd); - - if (af == AF_INET) { - struct sockaddr_in si; - DWORD len = size; - - memset(&si, 0, sizeof(si)); - si.sin_family = af; - memcpy(&si.sin_addr, src, sizeof(si.sin_addr)); - status = WSAAddressToString((struct sockaddr*)&si, sizeof(si), NULL, dst, &len); - } else if (af == AF_INET6) { - struct sockaddr_in6 si6; - DWORD len = size; - - memset(&si6, 0, sizeof(si6)); - si6.sin6_family = af; - memcpy(&si6.sin6_addr, src, sizeof(si6.sin6_addr)); - status = WSAAddressToString((struct sockaddr*)&si6, sizeof(si6), NULL, dst, &len); - } - - if (status != SOCKET_ERROR) - ret = dst; - else - errno = ENOSPC; - - WSACleanup(); - - return ret; -} - -int inet_pton(int af, const char *restrict src, void *restrict dst) -{ - INT status = SOCKET_ERROR; - WSADATA wsd; - int ret = 1; - - if (af != AF_INET && af != AF_INET6) { - errno = EAFNOSUPPORT; - return -1; - } - - WSAStartup(MAKEWORD(2,2), &wsd); - - if (af == AF_INET) { - struct sockaddr_in si; - INT len = sizeof(si); - - memset(&si, 0, sizeof(si)); - si.sin_family = af; - status = WSAStringToAddressA((char*)src, af, NULL, (struct sockaddr*)&si, &len); - if (status != SOCKET_ERROR) - memcpy(dst, &si.sin_addr, sizeof(si.sin_addr)); - } else if (af == AF_INET6) { - struct sockaddr_in6 si6; - INT len = sizeof(si6); - - memset(&si6, 0, sizeof(si6)); - si6.sin6_family = af; - status = WSAStringToAddressA((char*)src, af, NULL, (struct sockaddr*)&si6, &len); - if (status != SOCKET_ERROR) - memcpy(dst, &si6.sin6_addr, sizeof(si6.sin6_addr)); - } - - if (status == SOCKET_ERROR) { - errno = ENOSPC; - ret = 0; - } - - WSACleanup(); - - return ret; -} -#endif /* CONFIG_WINDOWS_XP */ diff --git a/os/windows/posix/include/arpa/inet.h b/os/windows/posix/include/arpa/inet.h index 056f1dd5..1024db37 100644 --- a/os/windows/posix/include/arpa/inet.h +++ b/os/windows/posix/include/arpa/inet.h @@ -12,10 +12,4 @@ typedef int in_addr_t; in_addr_t inet_network(const char *cp); -#ifdef CONFIG_WINDOWS_XP -const char *inet_ntop(int af, const void *restrict src, - char *restrict dst, socklen_t size); -int inet_pton(int af, const char *restrict src, void *restrict dst); -#endif - #endif /* ARPA_INET_H */ diff --git a/os/windows/posix/include/poll.h b/os/windows/posix/include/poll.h index 25b8183f..5099cf2e 100644 --- a/os/windows/posix/include/poll.h +++ b/os/windows/posix/include/poll.h @@ -5,20 +5,6 @@ typedef int nfds_t; -#ifdef CONFIG_WINDOWS_XP -struct pollfd -{ - int fd; - short events; - short revents; -}; - -#define POLLOUT 1 -#define POLLIN 2 -#define POLLERR 0 -#define POLLHUP 1 -#endif /* CONFIG_WINDOWS_XP */ - int poll(struct pollfd fds[], nfds_t nfds, int timeout); #endif /* POLL_H */ -- 2.25.1