Merge branch 'evelu-fiog' of https://github.com/ErwanAliasr1/fio
[fio.git] / os / os-solaris.h
index 1a411af664e8de947fc0497f59a12648e8d60fe0..ea1f081c89e5d24bdc2c6854e29916ccdacc4b1a 100644 (file)
@@ -46,6 +46,12 @@ struct solaris_rand_seed {
 #define os_ctime_r(x, y, z)     ctime_r((x), (y), (z))
 #define FIO_OS_HAS_CTIME_R
 
+#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
+
 typedef psetid_t os_cpu_mask_t;
 
 static inline int chardev_size(struct fio_file *f, unsigned long long *bytes)
@@ -164,10 +170,12 @@ static inline int fio_cpuset_exit(os_cpu_mask_t *mask)
        return 0;
 }
 
+#ifndef CONFIG_HAVE_GETTID
 static inline int gettid(void)
 {
        return pthread_self();
 }
+#endif
 
 /*
  * Should be enough, not aware of what (if any) restrictions Solaris has