summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2012-07-02 12:47:06 +0200
committerBjörn Jacke <bj@sernet.de>2012-07-26 15:18:30 +0200
commit887cebffd06c1a9e8b3979c209cebf230de49d45 (patch)
treef191c031189757fc71256ef46b05222b6b9c12ef
parentd347c8d5775261a59679bc7ecd3b5e9b5b9ccca7 (diff)
downloadsamba-887cebffd06c1a9e8b3979c209cebf230de49d45.tar.gz
samba-887cebffd06c1a9e8b3979c209cebf230de49d45.tar.bz2
samba-887cebffd06c1a9e8b3979c209cebf230de49d45.zip
s3:waf: add Darwin sendfile() test
-rwxr-xr-xsource3/wscript23
1 files changed, 23 insertions, 0 deletions
diff --git a/source3/wscript b/source3/wscript
index 91ffc2599a..0be9a43154 100755
--- a/source3/wscript
+++ b/source3/wscript
@@ -1061,6 +1061,29 @@ main() {
conf.DEFINE('HAVE_SENDFILE', '1')
conf.DEFINE('FREEBSD_SENDFILE_API', '1')
conf.DEFINE('WITH_SENDFILE', '1')
+ elif (host_os.rfind('darwin') > -1):
+ conf.CHECK_CODE('''
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/uio.h>
+ int fromfd, tofd, ret;
+ off_t offset, nwritten;
+ struct sf_hdtr hdr;
+ struct iovec hdtrl;
+ hdr.headers = &hdtrl;
+ hdr.hdr_cnt = 1;
+ hdr.trailers = (void *)0;
+ hdr.trl_cnt = 0;
+ hdtrl.iov_base = (void *)0;
+ hdtrl.iov_len = 0;
+ ret = sendfile(fromfd, tofd, offset, &nwritten, &hdr, 0);
+ ''',
+ '_HAVE_SENDFILE',
+ msg='Checking for darwin sendfile support')
+ if conf.CONFIG_SET('_HAVE_SENDFILE'):
+ conf.DEFINE('HAVE_SENDFILE', '1')
+ conf.DEFINE('DARWIN_SENDFILE_API', '1')
+ conf.DEFINE('WITH_SENDFILE', '1')
elif (host_os.rfind('hpux') > -1) or (host_os.rfind('osf') > -1):
conf.CHECK_CODE('''
#include <sys/socket.h>