diff --git a/configure.ac b/configure.ac index 0b6eb1ec7f..2df13d8ad2 100644 --- a/configure.ac +++ b/configure.ac @@ -833,6 +833,9 @@ AC_CHECK_FUNCS(pthread_rwlockattr_setkind_np) AC_CHECK_FUNCS(pthread_cancel) AC_CHECK_FUNCS(sigset) +dnl Check for fallocate() system call +AC_CHECK_FUNCS(fallocate) + dnl Semaphores if test "$ac_cv_header_semaphore_h" = "yes"; then AC_SEARCH_LIBS(sem_init, rt pthread) diff --git a/src/jrd/os/posix/unix.cpp b/src/jrd/os/posix/unix.cpp index 6ae6e58dfb..09b430eab0 100644 --- a/src/jrd/os/posix/unix.cpp +++ b/src/jrd/os/posix/unix.cpp @@ -307,7 +307,7 @@ void PIO_extend(Database* dbb, jrd_file* main_file, const ULONG extPages, const * **************************************/ -#ifdef HAVE_LINUX_FALLOC_H +#if defined(HAVE_LINUX_FALLOC_H) && defined(HAVE_FALLOCATE) ULONG leftPages = extPages; for (jrd_file* file = main_file; file && leftPages; file = file->fil_next) { @@ -354,7 +354,7 @@ void PIO_extend(Database* dbb, jrd_file* main_file, const ULONG extPages, const } #else main_file->fil_flags |= FIL_no_fast_extend; -#endif // HAVE_LINUX_FALLOC_H +#endif // fallocate present // not implemented return;