From 998288337d87b9fac8ae3a2f06ee97bfa9bfdfa3 Mon Sep 17 00:00:00 2001 From: Lyude Paul Date: Tue, 23 Apr 2019 18:50:56 -0400 Subject: 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 Signed-off-by: Lyude Paul --- tests/core_auth.c | 6 ++---- tests/drm_import_export.c | 2 +- tests/i915/gem_close_race.c | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/core_auth.c b/tests/core_auth.c index 1bdc2261..49cad7cd 100644 --- a/tests/core_auth.c +++ b/tests/core_auth.c @@ -46,9 +46,7 @@ #include #include "drm.h" -#ifdef __linux__ -# include -#else +#ifndef __linux__ # include #endif @@ -62,7 +60,7 @@ is_local_tid(pid_t tid) #else /* On Linux systems, drmGetClient() would return the thread ID instead of the actual process ID */ - return syscall(SYS_gettid) == tid; + return gettid() == tid; #endif } diff --git a/tests/drm_import_export.c b/tests/drm_import_export.c index 4bc7b7d4..e1b0abae 100644 --- a/tests/drm_import_export.c +++ b/tests/drm_import_export.c @@ -120,7 +120,7 @@ static void start_test(void) static void * test_thread(void * par) { #ifdef __linux__ - igt_debug("start %ld\n", syscall(SYS_gettid)); + igt_debug("start %ld\n", gettid()); #else igt_debug("start %ld\n", (long) pthread_self()); #endif diff --git a/tests/i915/gem_close_race.c b/tests/i915/gem_close_race.c index 11d626dc..57e00480 100644 --- a/tests/i915/gem_close_race.c +++ b/tests/i915/gem_close_race.c @@ -51,7 +51,6 @@ static uint32_t devid; static bool has_64bit_relocations; -#define gettid() syscall(__NR_gettid) #define sigev_notify_thread_id _sigev_un._tid static void selfcopy(int fd, uint32_t handle, int loops) -- cgit v1.2.3