From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5435 invoked by alias); 11 Jun 2012 05:59:43 -0000 Received: (qmail 5152 invoked by uid 22791); 11 Jun 2012 05:59:42 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Jun 2012 05:59:29 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id q5B5xNZO030603; Mon, 11 Jun 2012 07:59:23 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id q5B5xMmB012288; Mon, 11 Jun 2012 07:59:22 +0200 (CEST) Date: Mon, 11 Jun 2012 05:59:00 -0000 Message-Id: <201206110559.q5B5xMmB012288@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: michael.hope@linaro.org CC: gdb-patches@sourceware.org, patches@linaro.org In-reply-to: <4FD57332.6020309@linaro.org> (message from Michael Hope on Mon, 11 Jun 2012 16:25:22 +1200) Subject: Re: [PATCH] Check for POSIX_MADV_WILLNEED to support building against the LSB References: <4FD57332.6020309@linaro.org> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00268.txt.bz2 > Date: Mon, 11 Jun 2012 16:25:22 +1200 > From: Michael Hope > > The Linux Standard Base APIs include posix_madvise() but don't define > values for the 'advice' argument. Check to see if POSIX_MADV_WILLNEED > is defined before using. What real-world problem does this fix? It makes no sense to have posix_madvise() but not define any values for the 'advice' argument. I'd say this is a "bug" in LSB. Either they should drop posix_madvise() from the standard, or include at least the 'advice' values required by POSIX. > 2012-06-11 Michael Hope > > * dwarf2read.c (dwarf2_read_section): Check for > POSIX_MADV_WILLNEED. > > diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c > index 589361e..91fab5a 100644 > --- a/gdb/dwarf2read.c > +++ b/gdb/dwarf2read.c > @@ -1773,7 +1773,7 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) > > if ((caddr_t)info->buffer != MAP_FAILED) > { > -#if HAVE_POSIX_MADVISE > +#if HAVE_POSIX_MADVISE && defined(POSIX_MADV_WILLNEED) > posix_madvise (info->map_addr, info->map_len, POSIX_MADV_WILLNEED); > #endif > return; >