From 2a32d5765a1d07e07c73c727eedcf5a7db3b261c Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Tue, 24 Sep 2013 16:13:27 +0100 Subject: [PATCH] server: Android has struct user in asm/user.h. --- configure | 1 + configure.ac | 1 + include/config.h.in | 3 +++ server/ptrace.c | 8 +++++++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/configure b/configure index d1cd164b98c..58f25791a22 100755 --- a/configure +++ b/configure @@ -5949,6 +5949,7 @@ for ac_header in \ arpa/inet.h \ arpa/nameser.h \ asm/types.h \ + asm/user.h \ curses.h \ direct.h \ dirent.h \ diff --git a/configure.ac b/configure.ac index 0fce454dec1..1055b0a62bb 100644 --- a/configure.ac +++ b/configure.ac @@ -409,6 +409,7 @@ AC_CHECK_HEADERS(\ arpa/inet.h \ arpa/nameser.h \ asm/types.h \ + asm/user.h \ curses.h \ direct.h \ dirent.h \ diff --git a/include/config.h.in b/include/config.h.in index 5863d10bc04..01e484ec845 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -35,6 +35,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ASM_TYPES_H +/* Define to 1 if you have the header file. */ +#undef HAVE_ASM_USER_H + /* Define to 1 if you have the header file. */ #undef HAVE_AUDIOTOOLBOX_AUDIOCONVERTER_H diff --git a/server/ptrace.c b/server/ptrace.c index ed72b7d74bd..9897a085806 100644 --- a/server/ptrace.c +++ b/server/ptrace.c @@ -528,9 +528,15 @@ void get_selector_entry( struct thread *thread, int entry, unsigned int *base, } -#if defined(linux) && defined(HAVE_SYS_USER_H) && (defined(__i386__) || defined(__x86_64__)) +#if defined(linux) && (defined(HAVE_SYS_USER_H) || defined(HAVE_ASM_USER_H)) \ + && (defined(__i386__) || defined(__x86_64__)) +#ifdef HAVE_SYS_USER_H #include +#endif +#ifdef HAVE_ASM_USER_H +#include +#endif /* debug register offset in struct user */ #define DR_OFFSET(dr) ((((struct user *)0)->u_debugreg) + (dr))