#define FIO_HAVE_CPU_AFFINITY
#define FIO_HAVE_CHARDEV_SIZE
#define FIO_HAVE_GETTID
-#define FIO_USE_GENERIC_RAND
+#define FIO_EMULATED_MKDIR_TWO
#define FIO_PREFERRED_ENGINE "windowsaio"
#define FIO_PREFERRED_CLOCK_SOURCE CS_CGETTIME
/* Winsock doesn't support MSG_WAIT */
#define OS_MSG_DONTWAIT 0
+#ifndef S_ISSOCK
+#define S_ISSOCK(x) 0
+#endif
+
#define SIGCONT 0
#define SIGUSR1 1
#define SIGUSR2 2
return (unsigned long long) pages * (unsigned long long) pagesize;
}
+#ifndef CONFIG_HAVE_GETTID
static inline int gettid(void)
{
return GetCurrentThreadId();
}
+#endif
-static inline int init_random_seeds(unsigned long *rand_seeds, int size)
+static inline int init_random_seeds(uint64_t *rand_seeds, int size)
{
HCRYPTPROV hCryptProv;
return (SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE))? 0 : -1;
}
+static inline int fio_mkdir(const char *path, mode_t mode) {
+ DWORD dwAttr = GetFileAttributesA(path);
+
+ if (dwAttr != INVALID_FILE_ATTRIBUTES &&
+ (dwAttr & FILE_ATTRIBUTE_DIRECTORY)) {
+ errno = EEXIST;
+ return -1;
+ }
+
+ if (CreateDirectoryA(path, NULL) == 0) {
+ log_err("CreateDirectoryA = %d\n", GetLastError());
+ errno = win_to_posix_error(GetLastError());
+ return -1;
+ }
+
+ return 0;
+}
+
#ifdef CONFIG_WINDOWS_XP
#include "os-windows-xp.h"
#else