$NetBSD: patch-ab,v 1.13 2013/07/26 11:37:22 ryoon Exp $

On Debian GNU/kFreeBSD 7.0, there is posix_fadvise(2), but no
POSIX_FADV_WILLNEED.

--- src/fccache.c.orig	2013-03-21 09:50:26.000000000 +0000
+++ src/fccache.c
@@ -31,6 +31,7 @@
 #include <dirent.h>
 #include <string.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <assert.h>
 #if defined(HAVE_MMAP) || defined(__CYGWIN__)
 #  include <unistd.h>
@@ -575,7 +576,7 @@ FcDirCacheMapFd (int fd, struct stat *fd
     {
 #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)
