This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[PATCH] GNU/kFreeBSD: No posix_fadvise
- From: Kurt Roeckx <kurt at roeckx dot be>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Fri, 14 Aug 2009 17:18:01 +0200
- Subject: [PATCH] GNU/kFreeBSD: No posix_fadvise
Hi,
The attached patch was written by
Petr Salinger <Petr.Salinger@seznam.cz>.
It seems that GNU/kFreeBSD does not have the posix_fadvise
function.
Kurt
diff --git a/src/strings.c b/src/strings.c
index b69f2ad..cb61508 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -586,9 +586,11 @@ read_block (int fd, const char *fname, off64_t fdlen, off64_t from, off64_t to)
elfmap_off = from & ~(ps - 1);
elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
+#ifdef POSIX_FADV_SEQUENTIAL
if (unlikely (elfmap == MAP_FAILED))
/* Let the kernel know we are going to read everything in sequence. */
(void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
+#endif
}
if (unlikely (elfmap == MAP_FAILED))