Ticket #2610: Use posix_fallocate() when copying files/moving to a new mount point

Added m4 function for check if posix_fallocate() is present.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2011-09-20 11:41:27 +03:00
parent 490711fca7
commit 7fbdb87805

View File

@ -635,6 +635,27 @@ AC_DEFUN([gl_FSTYPENAME],
])
])
dnl
dnl posix_allocate() function detection
dnl
AC_DEFUN([gl_POSIX_FALLOCATE], [
dnl * Old glibcs have broken posix_fallocate(). Make sure not to use it.
AC_TRY_COMPILE([
#define _XOPEN_SOURCE 600
#include <stdlib.h>
#if defined(__GLIBC__) && (__GLIBC__ < 2 || __GLIBC_MINOR__ < 7)
possibly broken posix_fallocate
#endif
],
[posix_fallocate(0, 0, 0);],
[AC_DEFINE(
[HAVE_POSIX_FALLOCATE],
[1],
[Define if you have a working posix_fallocate()])
])
])
dnl
dnl Filesystem information detection
dnl
@ -651,4 +672,5 @@ AC_DEFUN([AC_GET_FS_INFO], [
gl_FSUSAGE
gl_FSTYPENAME
gl_POSIX_FALLOCATE
])