From: Michael Hope <michael.hope@linaro.org>
To: gdb-patches@sourceware.org
Cc: patches@linaro.org
Subject: [PATCH] Check for POSIX_MADV_WILLNEED to support building against the LSB
Date: Mon, 11 Jun 2012 04:25:00 -0000 [thread overview]
Message-ID: <4FD57332.6020309@linaro.org> (raw)
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.
OK for trunk?
-- Michael
2012-06-11 Michael Hope <michael.hope@linaro.org>
* 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;
next reply other threads:[~2012-06-11 4:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-11 4:25 Michael Hope [this message]
2012-06-11 5:59 ` Mark Kettenis
2012-06-11 6:17 ` Michael Hope
2012-06-11 8:19 ` Mark Kettenis
2012-06-11 21:40 ` Michael Hope
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FD57332.6020309@linaro.org \
--to=michael.hope@linaro.org \
--cc=gdb-patches@sourceware.org \
--cc=patches@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox