summaryrefslogtreecommitdiff
path: root/lib/igt_aux.h
diff options
context:
space:
mode:
authorArkadiusz Hiler <arkadiusz.hiler@intel.com>2017-04-12 09:28:45 +0200
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2017-06-07 13:26:28 +0300
commit86b59f8474a38b7a0e9c4cf68e32aba664878107 (patch)
tree11faf9d133d13f2dd359df616328ceb03f4fba16 /lib/igt_aux.h
parent17f9e36c8e7ebc1bbdc943e064468698e48f8e49 (diff)
lib/igt_aux: Include unistd.h for gettid() on Android
We define gettid() using syscall() because glibc does not provide a wrapper. Android's bionic got the syscall covered though. Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'lib/igt_aux.h')
-rw-r--r--lib/igt_aux.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/igt_aux.h b/lib/igt_aux.h
index e62858e6..54b97164 100644
--- a/lib/igt_aux.h
+++ b/lib/igt_aux.h
@@ -43,7 +43,12 @@ extern int num_trash_bos;
#define NSEC_PER_SEC (1000*USEC_PER_SEC)
/* signal interrupt helpers */
+#ifdef ANDROID
+#include <unistd.h> /* on Android bionic has this implemented */
+#else
#define gettid() syscall(__NR_gettid)
+#endif
+
#define sigev_notify_thread_id _sigev_un._tid
/* auxialiary igt helpers from igt_aux.c */