--- libeio/libeio.m4 2011/07/24 05:53:34 1.17 +++ libeio/libeio.m4 2012/04/10 05:01:34 1.18 @@ -123,7 +123,7 @@ ],ac_cv_sync_file_range=yes,ac_cv_sync_file_range=no)]) test $ac_cv_sync_file_range = yes && AC_DEFINE(HAVE_SYNC_FILE_RANGE, 1, sync_file_range(2) is available) -AC_CACHE_CHECK(for fallocate, ac_cv_fallocate, [AC_LINK_IFELSE([ +AC_CACHE_CHECK(for fallocate, ac_cv_flinux_allocate, [AC_LINK_IFELSE([ #include int main (void) { @@ -135,8 +135,8 @@ res = fallocate (fd, mode, offset, len); return 0; } -],ac_cv_fallocate=yes,ac_cv_fallocate=no)]) -test $ac_cv_fallocate = yes && AC_DEFINE(HAVE_FALLOCATE, 1, fallocate(2) is available) +],ac_cv_linux_fallocate=yes,ac_cv_linux_fallocate=no)]) +test $ac_cv_linux_fallocate = yes && AC_DEFINE(HAVE_LINUX_FALLOCATE, 1, fallocate(2) is available) AC_CACHE_CHECK(for sys_syncfs, ac_cv_sys_syncfs, [AC_LINK_IFELSE([ #include @@ -193,3 +193,19 @@ ],ac_cv_posix_fadvise=yes,ac_cv_posix_fadvise=no)]) test $ac_cv_posix_fadvise = yes && AC_DEFINE(HAVE_POSIX_FADVISE, 1, posix_fadvise(2) is available) +dnl lots of linux specifics +AC_CHECK_HEADERS([linux/fs.h linux/fiemap.h]) + +AC_CACHE_CHECK([for splice, vmsplice and tee], ac_cv_linux_splice, [AC_LINK_IFELSE([ +#include +int main (void) +{ + ssize_t res; + res = splice ((int)0, (loff_t)0, (int)0, (loff_t *)0, (size_t)0, SPLICE_F_MOVE | SPLICE_F_NONBLOCK | SPLICE_F_MORE); + res = tee ((int)0, (int)0, (size_t)0, SPLICE_F_NONBLOCK); + res = vmsplice ((int)0, (struct iovec *)0, 0, SPLICE_F_NONBLOCK | SPLICE_F_GIFT); + return 0; +} +],ac_cv_linux_splice=yes,ac_cv_linux_splice=no)]) +test $ac_cv_linux_splice = yes && AC_DEFINE(HAVE_LINUX_SPLICE, 1, splice/vmsplice/tee(2) are available) +