summaryrefslogtreecommitdiff
path: root/source3/wscript
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-04-10 15:45:55 -0700
committerJeremy Allison <jra@samba.org>2012-04-11 02:29:04 +0200
commitfe707f6549292ccb681ccd0c596cbd17525522f3 (patch)
tree5667fd10fd30c77965870a172e90427015ac57b4 /source3/wscript
parent224379ba70a6939bd6a92012f023caeb7e43d6b7 (diff)
downloadsamba-fe707f6549292ccb681ccd0c596cbd17525522f3.tar.gz
samba-fe707f6549292ccb681ccd0c596cbd17525522f3.tar.bz2
samba-fe707f6549292ccb681ccd0c596cbd17525522f3.zip
Add a new module, aio_linux which implements Linux kernel aio support. Docs to follow.
Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Apr 11 02:29:04 CEST 2012 on sn-devel-104
Diffstat (limited to 'source3/wscript')
-rw-r--r--source3/wscript26
1 files changed, 26 insertions, 0 deletions
diff --git a/source3/wscript b/source3/wscript
index 24924cca00..0c2a51ede4 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -380,6 +380,29 @@ return acl_get_perm_np(permset_d, perm);
conf.CHECK_CODE('struct aiocb a; return aio_error(&a);', 'HAVE_AIO_ERROR', msg='Checking for aio_error', headers='aio.h', lib='aio rt')
conf.CHECK_CODE('struct aiocb a; return aio_cancel(1, &a);', 'HAVE_AIO_CANCEL', msg='Checking for aio_cancel', headers='aio.h', lib='aio rt')
conf.CHECK_CODE('struct aiocb a; return aio_suspend(&a, 1, NULL);', 'HAVE_AIO_SUSPEND', msg='Checking for aio_suspend', headers='aio.h', lib='aio rt')
+ if host_os.rfind('linux') > -1:
+ conf.CHECK_FUNCS_IN('io_submit', 'aio')
+ conf.CHECK_CODE('''
+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);
+''',
+ 'HAVE_LINUX_KERNEL_AIO',
+ msg='Checking for linux kernel asynchronous io support',
+ headers='unistd.h stdlib.h sys/types.h fcntl.h sys/eventfd.h libaio.h',
+ lib='aio')
+
if not conf.CONFIG_SET('HAVE_AIO'):
conf.DEFINE('HAVE_NO_AIO', '1')
else:
@@ -1576,6 +1599,9 @@ main() {
if conf.CONFIG_SET('HAVE_AIO') and Options.options.with_pthreadpool:
default_shared_modules.extend(TO_LIST('vfs_aio_pthread'))
+ if conf.CONFIG_SET('HAVE_AIO') and conf.CONFIG_SET('HAVE_LINUX_KERNEL_AIO'):
+ default_shared_modules.extend(TO_LIST('vfs_aio_linux'))
+
if conf.CONFIG_SET('HAVE_LDAP'):
default_static_modules.extend(TO_LIST('pdb_ldap idmap_ldap'))