CONFIGURE_OPTIONS:
DISTRO: cygwin
- ARCHITECTURE: x86
- CONFIGURE_OPTIONS: --build-32bit-win --target-win-ver=xp
+ CONFIGURE_OPTIONS: --build-32bit-win
DISTRO: cygwin
install:
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.
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
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"
# 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
+++ /dev/null
-#define FIO_MAX_CPUS MAXIMUM_PROCESSORS
-
-typedef DWORD_PTR os_cpu_mask_t;
#include "../lib/types.h"
#include "windows/posix.h"
+#include "os-windows-7.h"
#ifndef PTHREAD_STACK_MIN
#define PTHREAD_STACK_MIN 65535
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);
#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)
{
{
return 0;
}
-#endif /* CONFIG_WINDOWS_XP */
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 */
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 */
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 */