From a13852d93636405b7b3cf87f10521e52bcaafe48 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 7 Nov 2011 16:28:52 +0000 Subject: 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 --- sim/common/dv-cfi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sim/common/dv-cfi.c') 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, -- cgit v1.1