aboutsummaryrefslogtreecommitdiff
path: root/sim/common/dv-cfi.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-11-07 16:28:52 +0000
committerMike Frysinger <vapier@gentoo.org>2011-11-07 16:28:52 +0000
commita13852d93636405b7b3cf87f10521e52bcaafe48 (patch)
treed5c0de9bee6ecf11dd72636d479d8f5d066781bf /sim/common/dv-cfi.c
parent481d79819e0e47f23f20408a6595333012da6f58 (diff)
downloadgdb-a13852d93636405b7b3cf87f10521e52bcaafe48.zip
gdb-a13852d93636405b7b3cf87f10521e52bcaafe48.tar.gz
gdb-a13852d93636405b7b3cf87f10521e52bcaafe48.tar.bz2
sim: dv-cfi: check for posix_fallocate
Some systems (like OS X) do not have posix_fallocate. Add a configure check for it before we try to use it. This is less work than trying to support old systems. URL: http://sourceware.org/bugzilla/show_bug.cgi?id=13161 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sim/common/dv-cfi.c')
-rw-r--r--sim/common/dv-cfi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sim/common/dv-cfi.c b/sim/common/dv-cfi.c
index a1ecaf9..04b004b 100644
--- a/sim/common/dv-cfi.c
+++ b/sim/common/dv-cfi.c
@@ -727,7 +727,7 @@ attach_cfi_regs (struct hw *me, struct cfi *cfi)
/* 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,