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__