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>
#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)
{
struct in_addr;
+extern int _weak fallocate(int fd, int mode, off_t offset, off_t len);
extern int _weak posix_memalign(void **ptr, size_t align, size_t size);
extern int _weak posix_fallocate(int fd, off_t offset, off_t len);
extern int _weak inet_aton(const char *cp, struct in_addr *inp);
#define FIO_HAVE_BLKTRACE
#define FIO_HAVE_STRSEP
#define FIO_HAVE_FALLOCATE
-#define FIO_HAVE_LINUX_FALLOCATE
#define FIO_HAVE_POSIXAIO_FSYNC
#define FIO_HAVE_PSHARED_MUTEX
#define FIO_HAVE_CL_SIZE
#define FIO_HAVE_BINJECT
#define FIO_HAVE_CLOCK_MONOTONIC
+/*
+ * Can only enable this for newer glibcs, or the header and defines are
+ * missing
+ */
+#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 6
+#define FIO_HAVE_LINUX_FALLOCATE
+#endif
+
#ifdef SYNC_FILE_RANGE_WAIT_BEFORE
#define FIO_HAVE_SYNC_FILE_RANGE
#endif