summaryrefslogtreecommitdiffstats
path: root/src/strings.c
diff options
context:
space:
mode:
authorRoland McGrath <[email protected]>2009-08-14 12:50:24 -0700
committerRoland McGrath <[email protected]>2009-08-14 12:50:24 -0700
commit7b308d36c45f42d491dc178bf49788b481bc6415 (patch)
tree227fe51fb05b1ed0668466bdd807ab824aca6fd2 /src/strings.c
parent52c6e9a2836a0a3b24acb06beced7cf0a56d1bc1 (diff)
Conditionalize posix_fadvise use.
Diffstat (limited to 'src/strings.c')
-rw-r--r--src/strings.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/strings.c b/src/strings.c
index 50cdd686..349473d8 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -595,9 +595,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))