gettime: Fix compilation on non-Linux with pthread_getaffinity_np()
[fio.git] / os / os-openbsd.h
index 994bf078c9863a1fb0d28bcb940bd224fd1d4a1c..f1bad67165e982c4da1ecc743887ec8e4bbe056c 100644 (file)
 #define fio_swap32(x)  swap32(x)
 #define fio_swap64(x)  swap64(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
+
 static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
 {
        struct disklabel dl;