summaryrefslogtreecommitdiff
path: root/helpers.c
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-07-12 20:49:46 +0200
committerJens Axboe <jaxboe@fusionio.com>2011-07-12 20:49:46 +0200
commit804bb9a18bb747c8c7c481c9d8dca86a29837ecd (patch)
treed26ef774cd95924bbe732094b2bc54f4d37ea442 /helpers.c
parent7bb591020669b7266c57108f2a68b48a03ae72ee (diff)
downloadfio-804bb9a18bb747c8c7c481c9d8dca86a29837ecd.tar.gz
fio-804bb9a18bb747c8c7c481c9d8dca86a29837ecd.tar.bz2
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>
Diffstat (limited to 'helpers.c')
-rw-r--r--helpers.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/helpers.c b/helpers.c
index 1b6dea8e..95625672 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)
{