windows: drop XP support
authorSitsofe Wheeler <sitsofe@yahoo.com>
Wed, 23 Dec 2020 16:01:52 +0000 (16:01 +0000)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Sat, 26 Dec 2020 08:07:22 +0000 (08:07 +0000)
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 <sitsofe@yahoo.com>
.appveyor.yml
README
configure
os/os-windows-xp.h [deleted file]
os/os-windows.h
os/windows/cpu-affinity.c
os/windows/posix.c
os/windows/posix/include/arpa/inet.h
os/windows/posix/include/poll.h

index fad1632665d04724f7823f9f483040f55afb0c40..42b79958d46f20bb667a7c7049dde670aab791ec 100644 (file)
@@ -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 0f943bcca9016441e28de2d3ca759b2f767faad1..2fecf0e020077eeed24300882e553e772de050bb 100644 (file)
--- 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
index d247a041e463f2dd79c4af0f0301457475a46e5a..e3e37d569965d5c7c872cd8240e0b77bd85be8c8 100755 (executable)
--- 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 (file)
index fbc23e2..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#define FIO_MAX_CPUS   MAXIMUM_PROCESSORS
-
-typedef DWORD_PTR os_cpu_mask_t;
index fa2955f98659c84a539e26268bdb5a6673fb31ee..ddfae41344cfe23c5bac09ef9dfd4f6ace0e95c1 100644 (file)
@@ -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);
index 46fd048d3abc26180cff0d5bc66edeb436fd157e..7601970fc7c284bd120d0ed1b6637ed46882dae3 100644 (file)
@@ -2,78 +2,6 @@
 
 #include <windows.h>
 
-#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 */
index 9e9f12effbea9aaf738d159b4211ab617b3d2450..09c2e4a7857bd4121441b866c70657a935fde730 100644 (file)
@@ -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 */
index 056f1dd5822a91574dde256a6823accd5d28fc03..1024db378e68ed4df34680726b958e7fa30442cb 100644 (file)
@@ -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 */
index 25b8183fdfe45accb9d86b14c55e41afd27b8459..5099cf2ecaae1fa3a8490b0eb0815465e95d41fa 100644 (file)
@@ -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 */