projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gettime: Fix compilation on non-Linux with pthread_getaffinity_np()
[fio.git]
/
os
/
os-dragonfly.h
diff --git
a/os/os-dragonfly.h
b/os/os-dragonfly.h
index 44bfcd5d064001722567d8c2011665b612a13d4b..6e46589450eaaf6b318724d61a157813e92f144d 100644
(file)
--- a/
os/os-dragonfly.h
+++ b/
os/os-dragonfly.h
@@
-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))
/* 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);
static inline int fio_cpuset_init(os_cpu_mask_t *mask)
{
CPUMASK_ASSZERO(*mask);