#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
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;
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)