From: tim.gore@intel.com Subject: [PATCH 1/3] intel-gpu-tools: fix problem with redefinition of mmap64 Date: Fri, 28 Mar 2014 12:54:58 +0000 Message-ID: <1396011300-11605-2-git-send-email-tim.gore@intel.com> References: <1396011300-11605-1-git-send-email-tim.gore@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C2396ECBF for ; Fri, 28 Mar 2014 05:56:00 -0700 (PDT) In-Reply-To: <1396011300-11605-1-git-send-email-tim.gore@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org From: tgore In android builds there is no reliable way to determine if mmap64 is defined or not, and this sometimes leads to a compile error due to its re-defnition. So this commit avoids its use altogether in intel-gpu-tools for Android builds, unless the HAVE_MMAP64 macro is defined. Signed-off-by: Tim Gore --- lib/drmtest.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/drmtest.h b/lib/drmtest.h index fdf98c6..f3afbaa 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -40,7 +40,11 @@ #ifdef ANDROID #ifndef HAVE_MMAP64 extern void* __mmap2(void *, size_t, int, int, int, off_t); -static inline void *mmap64(void *addr, size_t length, int prot, int flags, + +/* mmap64 is a recent addition to bionic and not available in all android builds. */ +/* I can find no reliable way to know if it is defined or not - so just avoid it */ +#define mmap64 igt_mmap64 +static inline void *igt_mmap64(void *addr, size_t length, int prot, int flags, int fd, off64_t offset) { return __mmap2(addr, length, prot, flags, fd, offset >> 12); -- 1.9.0