# HG changeset patch # User Timo Sirainen # Date 1200500649 -7200 # Node ID d349cdeddc7dc7fe20248bcf29bd4895671a6658 # Parent b7fc50c68c351cfe24327301efc83f3a9f532505 Don't use posix_fallocate() with GLIBC versions older than 2.7. It probably works with a bit older versions, but at least in 2.3.5 it can cause infinite loops. diff -r b7fc50c68c35 -r d349cdeddc7d configure.in --- a/configure.in Tue Jan 15 18:16:06 2008 +0200 +++ b/configure.in Wed Jan 16 18:24:09 2008 +0200 @@ -431,7 +431,7 @@ setrlimit setproctitle seteuid setreuid setegid setresgid \ strtoull strtouq setpriority quotactl getmntent kqueue kevent \ backtrace_symbols walkcontext dirfd \ - malloc_usable_size posix_fallocate) + malloc_usable_size) dnl * I/O loop function have_ioloop=no @@ -596,6 +596,19 @@ AC_DEFINE(PREAD_WRAPPERS,, Define if pread/pwrite needs _XOPEN_SOURCE 500) ]) +dnl * Old glibcs have broken posix_fallocate(). Make sure not to use it. +AC_TRY_COMPILE([ + #define _XOPEN_SOURCE 600 + #include + #if defined(__GLIBC__) && (__GLIBC__ < 2 || __GLIBC_MINOR__ < 7) + possibly broken posix_fallocate + #endif +], [ + posix_fallocate(0, 0, 0); +], [ + AC_DEFINE(HAVE_POSIX_FALLOCATE,, Define if you have a working posix_fallocate()) +]) + dnl * OS specific options case "$host_os" in hpux*)