diff --git a/src/fccache.c b/src/fccache.c index 3568595..c7f2437 100644 --- a/src/fccache.c +++ b/src/fccache.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #if defined(HAVE_MMAP) || defined(__CYGWIN__) # include @@ -572,7 +573,7 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat) { #if defined(HAVE_MMAP) || defined(__CYGWIN__) cache = mmap (0, fd_stat->st_size, PROT_READ, MAP_SHARED, fd, 0); -#ifdef HAVE_POSIX_FADVISE +#if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED) posix_fadvise (fd, 0, fd_stat->st_size, POSIX_FADV_WILLNEED); #endif if (cache == MAP_FAILED)