configure: add gettid() test
[fio.git] / os / os-windows.h
index ddb752800191d77f679e53bfa641a56a3a214b6e..3e9f73413b26a5f2c5e778b63df4281f2e7df994 100644 (file)
@@ -13,6 +13,7 @@
 #include <stdlib.h>
 
 #include "../smalloc.h"
+#include "../debug.h"
 #include "../file.h"
 #include "../log.h"
 #include "../lib/hweight.h"
@@ -34,7 +35,6 @@ int rand_r(unsigned *);
 #define FIO_HAVE_CPU_AFFINITY
 #define FIO_HAVE_CHARDEV_SIZE
 #define FIO_HAVE_GETTID
-#define FIO_USE_GENERIC_RAND
 
 #define FIO_PREFERRED_ENGINE           "windowsaio"
 #define FIO_PREFERRED_CLOCK_SOURCE     CS_CGETTIME
@@ -73,6 +73,10 @@ int rand_r(unsigned *);
 /* 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
@@ -158,12 +162,14 @@ static inline unsigned long long os_phys_mem(void)
        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;
 
@@ -191,6 +197,10 @@ static inline int fio_set_sched_idle(void)
        return (SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE))? 0 : -1;
 }
 
+#ifdef CONFIG_WINDOWS_XP
 #include "os-windows-xp.h"
+#else
+#include "os-windows-7.h"
+#endif
 
 #endif /* FIO_OS_WINDOWS_H */