[Intel-gfx] [PATCH i-g-t 03/13] lib/igt_aux: Include unistd.h for gettid() on Android

Jani Nikula jani.nikula at linux.intel.com
Wed Apr 19 12:22:19 UTC 2017


On Wed, 19 Apr 2017, Arkadiusz Hiler <arkadiusz.hiler at intel.com> wrote:
> 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 at intel.com>
> ---
>  lib/igt_aux.h | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/lib/igt_aux.h b/lib/igt_aux.h
> index e62858e..54b9716 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

Seems like this should be something like HAVE_GETTID, defined by
configure or by android makefiles?

BR,
Jani.

> +#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 */

-- 
Jani Nikula, Intel Open Source Technology Center


More information about the Intel-gfx mailing list