Fix compile on older systems that don't have fallocate() on Linux
Commit a596f047 broke build en eg CentOS 5:
filesetup.c:17:26: error: linux/falloc.h: No such file or directory
filesetup.c: In function 'extend_file':
filesetup.c:95: warning: implicit declaration of function 'fallocate'
filesetup.c:95: error: 'FALLOC_FL_KEEP_SIZE' undeclared (first use in this function)
filesetup.c:95: error: (Each undeclared identifier is reported only once
filesetup.c:95: error: for each function it appears in.)
make: *** [filesetup.o] Error 1
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
diff --git a/helpers.c b/helpers.c
index 1b6dea8..9562567 100644
--- a/helpers.c
+++ b/helpers.c
@@ -9,6 +9,12 @@
#include "arch/arch.h"
#include "os/os.h"
+int _weak fallocate(int fd, int mode, off_t offset, off_t len)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
#ifndef __NR_fallocate
int _weak posix_fallocate(int fd, off_t offset, off_t len)
{