#include "../file.h"
#include "../log.h"
+#include "windows/posix.h"
+
#define FIO_HAVE_ODIRECT
#define FIO_HAVE_CPU_AFFINITY
#define FIO_HAVE_CHARDEV_SIZE
#define FIO_HAVE_FDATASYNC
#define FIO_HAVE_WINDOWSAIO
+#define FIO_HAVE_FALLOCATE
#define FIO_HAVE_GETTID
-#define FIO_HAVE_CLOCK_MONOTONIC
#define FIO_USE_GENERIC_RAND
#define FIO_PREFERRED_ENGINE "windowsaio"
#define FIO_MAX_CPUS MAXIMUM_PROCESSORS
-#define FIO_OS_HAVE_SOCKLEN_T
-typedef int fio_socklen_t;
-
#define OS_MAP_ANON MAP_ANON
-#define FIO_LITTLE_ENDIAN
#define fio_swap16(x) _byteswap_ushort(x)
#define fio_swap32(x) _byteswap_ulong(x)
#define fio_swap64(x) _byteswap_uint64(x)
-typedef off_t off64_t;
-typedef int clockid_t;
-
typedef DWORD_PTR os_cpu_mask_t;
#define CLOCK_REALTIME 1
#define POLLHUP 1
#define SIGCONT 0
+#define SIGUSR1 1
+#define SIGUSR2 2
typedef int sigset_t;
typedef int siginfo_t;
void* (*sa_sigaction)(int, siginfo_t *, void*);
};
-char *strsep(char **stringp, const char *delim);
long sysconf(int name);
int kill(pid_t pid, int sig);
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, cpumask);
+
CloseHandle(h);
+ } else {
+ log_err("fio_setaffinity failed: failed to get handle for pid %d\n", pid);
}
return (bSuccess)? 0 : -1;
static inline void fio_cpu_set(os_cpu_mask_t *mask, int cpu)
{
- *mask |= 1 << (cpu-1);
+ *mask |= 1 << cpu;
}
static inline int fio_cpuset_init(os_cpu_mask_t *mask)