summaryrefslogtreecommitdiff
path: root/lib/igt_aux.h
diff options
context:
space:
mode:
authorLyude Paul <lyude@redhat.com>2019-04-23 18:50:56 -0400
committerLyude Paul <lyude@redhat.com>2019-05-07 17:37:56 -0400
commit998288337d87b9fac8ae3a2f06ee97bfa9bfdfa3 (patch)
tree01cf7f5109a92232da85b3ff50343b3106c31dc6 /lib/igt_aux.h
parent71a46ea98a946437993b16b1cb2433f85d19a94e (diff)
Use gettid() wrapper everywhere
Currently we have multiple different parts of IGT that define their own wrapper around the gettid() syscall (or just call it directly with no wrapper). Additionally, add the appropriate #includes for igt_aux.h to make sure syscall() is available. Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'lib/igt_aux.h')
-rw-r--r--lib/igt_aux.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/igt_aux.h b/lib/igt_aux.h
index 67e8fbf4..a6e3770e 100644
--- a/lib/igt_aux.h
+++ b/lib/igt_aux.h
@@ -32,11 +32,16 @@
#include <stdbool.h>
#include <stddef.h>
#include <sys/time.h>
+#ifdef __linux__
+# include <sys/syscall.h>
+#endif
#include <i915/gem_submission.h>
/* signal interrupt helpers */
-#define gettid() syscall(__NR_gettid)
+#ifdef __linux__
+# define gettid() syscall(__NR_gettid)
+#endif
#define sigev_notify_thread_id _sigev_un._tid
/* auxialiary igt helpers from igt_aux.c */