+2011-11-07 Mike Frysinger <vapier@gentoo.org>
+
+ PR sim/13161
+ * configure.ac (AC_CHECK_FUNCS): Add posix_fallocate.
+ * configure, config.in: Regenerate.
+ * dv-cfi.c (attach_cfi_regs): Check for HAVE_POSIX_FALLOCATE.
+
2011-10-19 Mike Frysinger <vapier@gentoo.org>
* acinclude.m4: Call AC_CHECK_LIB when $hardware contains cfi.
/* Define to 1 if you have the `munmap' function. */
#undef HAVE_MUNMAP
+/* Define to 1 if you have the `posix_fallocate' function. */
+#undef HAVE_POSIX_FALLOCATE
+
/* Define to 1 if you have the `sigaction' function. */
#undef HAVE_SIGACTION
done
-for ac_func in mmap munmap lstat truncate ftruncate
+for ac_func in mmap munmap lstat truncate ftruncate posix_fallocate
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
# These aren't all needed yet, but will be eventually.
AC_CHECK_HEADERS(stdlib.h string.h strings.h time.h sys/times.h sys/stat.h sys/mman.h)
-AC_CHECK_FUNCS(mmap munmap lstat truncate ftruncate)
+AC_CHECK_FUNCS(mmap munmap lstat truncate ftruncate posix_fallocate)
AC_CHECK_MEMBERS([[struct stat.st_dev], [struct stat.st_ino],
[struct stat.st_mode], [struct stat.st_nlink], [struct stat.st_uid],
[struct stat.st_gid], [struct stat.st_rdev], [struct stat.st_size],
/* Figure out where our initial flash data is coming from. */
if (fd != -1 && fd_writable)
{
-#ifdef HAVE_MMAP
+#if defined (HAVE_MMAP) && defined (HAVE_POSIX_FALLOCATE)
posix_fallocate (fd, 0, cfi->dev_size);
cfi->mmap = mmap (NULL, cfi->dev_size,