fio: use the proper enum type for the shifted IO engine flags
[fio.git] / os / os-windows.h
index 9e931c9c9e505d8438117cd89c72a5d2a3dae7ab..616ad43567b0719a92f9f2ecee6143a15a0b0e46 100644 (file)
 #include "../file.h"
 #include "../log.h"
 #include "../lib/hweight.h"
+#include "../oslib/strcasestr.h"
 
 #include "windows/posix.h"
 
+/* Cygwin doesn't define rand_r if C99 or newer is being used */
+#if defined(WIN32) && !defined(rand_r)
+int rand_r(unsigned *);
+#endif
+
 #ifndef PTHREAD_STACK_MIN
 #define PTHREAD_STACK_MIN 65535
 #endif
@@ -187,7 +193,7 @@ static inline int fio_setaffinity(int pid, os_cpu_mask_t cpumask)
        return (bSuccess)? 0 : -1;
 }
 
-static inline void fio_getaffinity(int pid, os_cpu_mask_t *mask)
+static inline int fio_getaffinity(int pid, os_cpu_mask_t *mask)
 {
        os_cpu_mask_t systemMask;
 
@@ -198,7 +204,10 @@ static inline void fio_getaffinity(int pid, os_cpu_mask_t *mask)
                CloseHandle(h);
        } else {
                log_err("fio_getaffinity failed: failed to get handle for pid %d\n", pid);
+               return -1;
        }
+
+       return 0;
 }
 
 static inline void fio_cpu_clear(os_cpu_mask_t *mask, int cpu)