gettime: Fix compilation on non-Linux with pthread_getaffinity_np()
[fio.git] / os / os-mac.h
index 683aab3220a54f4125ebe97327be75b2a2b64d86..ec2cc1e555f43c2bc5afce2cc35396ebd7adfc1d 100644 (file)
 #define fio_swap32(x)  OSSwapInt32(x)
 #define fio_swap64(x)  OSSwapInt64(x)
 
+#ifdef CONFIG_PTHREAD_GETAFFINITY
+#define FIO_HAVE_GET_THREAD_AFFINITY
+#define fio_get_thread_affinity(mask)  \
+       pthread_getaffinity_np(pthread_self(), sizeof(mask), &(mask))
+#endif
+
 #ifndef CONFIG_CLOCKID_T
 typedef unsigned int clockid_t;
 #endif