gettime: Fix compilation on non-Linux with pthread_getaffinity_np()
[fio.git] / os / os-dragonfly.h
index 44bfcd5d064001722567d8c2011665b612a13d4b..6e46589450eaaf6b318724d61a157813e92f144d 100644 (file)
@@ -92,6 +92,12 @@ typedef cpumask_t os_cpu_mask_t;
 /* No CPU_COUNT(), but use the default function defined in os/os.h */
 #define fio_cpu_count(mask)             CPU_COUNT((mask))
 
+#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 fio_cpuset_init(os_cpu_mask_t *mask)
 {
        CPUMASK_ASSZERO(*mask);