diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/igt_aux.h | 7 | ||||
-rw-r--r-- | lib/igt_core.c | 2 |
2 files changed, 7 insertions, 2 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 */ diff --git a/lib/igt_core.c b/lib/igt_core.c index 3141d923..43fa197f 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -1992,7 +1992,7 @@ static void fatal_sig_handler(int sig) #ifdef __linux__ /* Workaround cached PID and TID races on glibc and Bionic libc. */ pid_t pid = syscall(SYS_getpid); - pid_t tid = syscall(SYS_gettid); + pid_t tid = gettid(); syscall(SYS_tgkill, pid, tid, sig); #else |