diff options
author | Patrik Nyblom <[email protected]> | 2013-03-18 10:43:20 +0100 |
---|---|---|
committer | Patrik Nyblom <[email protected]> | 2013-03-18 10:43:20 +0100 |
commit | ab7af05626c702aae342c708028761cea220a3f3 (patch) | |
tree | 3903607accd85cfff7c7c70687d1d7d5b2a8f22e /erts/configure.in | |
parent | fe18e8fc06ca156e0de76a6cf3f8068856746a36 (diff) | |
parent | 6f49c18b744416207997de4497c1f17b98a45f77 (diff) | |
download | otp-ab7af05626c702aae342c708028761cea220a3f3.tar.gz otp-ab7af05626c702aae342c708028761cea220a3f3.tar.bz2 otp-ab7af05626c702aae342c708028761cea220a3f3.zip |
Merge branch 'pan/fallocate_stricter_autoconf' into maint
* pan/fallocate_stricter_autoconf:
Make configure test for fallocate try to link
OTP-10948
Diffstat (limited to 'erts/configure.in')
-rw-r--r-- | erts/configure.in | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/erts/configure.in b/erts/configure.in index 7257751068..2ee907b6e4 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -1082,8 +1082,26 @@ fi AC_SUBST(ERTS_BUILD_SMP_EMU) -AC_CHECK_FUNCS([posix_fadvise, fallocate]) +AC_CHECK_FUNCS([posix_fadvise]) AC_CHECK_HEADERS([linux/falloc.h]) +dnl * Old glibcs have broken fallocate64(). Make sure not to use it. +AC_CACHE_CHECK([whether fallocate() works],i_cv_fallocate_works,[ + AC_TRY_LINK([ + #include <stdio.h> + #include <stdlib.h> + #include <fcntl.h> + #include <unistd.h> + #include <fcntl.h> + #include <linux/falloc.h> + ], + [ + int fd = creat("conftest.temp", 0600); + fallocate(fd, FALLOC_FL_KEEP_SIZE,(off_t) 1024,(off_t) 1024); + ], i_cv_fallocate_works=yes, i_cv_fallocate_works=no) +]) +if test $i_cv_fallocate_works = yes; then + AC_DEFINE(HAVE_FALLOCATE, 1, Define if you have a working fallocate()) +fi dnl * Old glibcs have broken posix_fallocate(). Make sure not to use it. dnl * It may also be broken in AIX. |