summaryrefslogtreecommitdiff
path: root/source3/configure.in
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-04-20 15:53:55 -0700
committerJeremy Allison <jra@samba.org>2012-04-23 09:19:16 -0700
commitfbaaf4b21fd7253d333261ba925e8f40122335e8 (patch)
tree6e0c1250a214e6f9e77b089e2da37a616f07e620 /source3/configure.in
parent5960b7b2a44161dba5dc96e6973e1fcc92b14bdd (diff)
downloadsamba-fbaaf4b21fd7253d333261ba925e8f40122335e8.tar.gz
samba-fbaaf4b21fd7253d333261ba925e8f40122335e8.tar.bz2
samba-fbaaf4b21fd7253d333261ba925e8f40122335e8.zip
Add complete test program for Linux kernel aio inside configure.in (I discovered yesterday there are systems with only half the glibc changes needed to implement userspace kaio.
Diffstat (limited to 'source3/configure.in')
-rw-r--r--source3/configure.in34
1 files changed, 28 insertions, 6 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 35bbe2873c..56112e9ca5 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -5545,12 +5545,34 @@ if test x"$samba_cv_HAVE_AIO" = x"yes"; then
# Check for Linux kernel aio support.
case "$host_os" in
*linux*)
- AC_MSG_CHECKING(for Linux kernel asynchronous io support)
- AC_CHECK_LIB(aio,io_submit,
- [AIO_LIBS="$LIBS -laio";
- AC_DEFINE(HAVE_LINUX_KERNEL_AIO, 1, Define to 1 if there is support for Linux kernel asynchronous io)],
- [])
- if test x"$ac_cv_lib_aio_io_submit" = x"yes"; then
+ AC_CHECK_LIB(aio,io_submit,[AIO_LIBS="$LIBS -laio"])
+ AC_CACHE_CHECK([for Linux kernel asynchronous io support],samba_cv_HAVE_LINUX_KERNEL_AIO,[
+ aio_LIBS=$LIBS
+ LIBS=$AIO_LIBS
+ AC_TRY_LINK([#include <unistd.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <sys/eventfd.h>
+#include <libaio.h>],
+[ struct io_event ioev;
+struct iocb *ioc;
+io_context_t ctx;
+struct timespec ts;
+int fd;
+char *buf;
+fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
+io_queue_init(128,&ctx);
+io_prep_pwrite(ioc, 1, buf, 1, 0);
+io_prep_pread(ioc, 1, buf, 1, 0);
+io_set_eventfd(ioc, fd);
+io_set_callback(ioc, (io_callback_t)(0));
+io_submit(ctx, 1, &ioc);
+io_getevents(ctx, 1, 1, &ioev, &ts);],
+samba_cv_HAVE_LINUX_KERNEL_AIO=yes,samba_cv_HAVE_LINUX_KERNEL_AIO=no)
+ LIBS=$aio_LIBS])
+ if test x"$samba_cv_HAVE_LINUX_KERNEL_AIO" = x"yes"; then
+ AC_DEFINE(WITH_AIO, 1, [Using asynchronous io])
default_shared_modules="$default_shared_modules vfs_aio_linux"
fi
;;