From c4bdd4debe70a137af80cd5fcdaf432473895ce3 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 31 Jan 2010 21:52:45 +0000 Subject: [PATCH] fixed fallocate usage on linux distros that don't have it --- src/file.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/file.cpp b/src/file.cpp index b53f23c97..678465661 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -76,12 +76,16 @@ POSSIBILITY OF SUCH DAMAGE. #include #endif -#include // For __NR_fallocate +#include // For __NR_fallocate // circumvent the lack of support in glibc static int my_fallocate(int fd, int mode, loff_t offset, loff_t len) { +#ifdef __NR_fallocate return syscall(__NR_fallocate, fd, mode, offset, len); +#else + return EOPNOTSUPP; +#endif } #elif defined __APPLE__ && defined __MACH__