From 887cebffd06c1a9e8b3979c209cebf230de49d45 Mon Sep 17 00:00:00 2001 From: Björn Jacke Date: Mon, 2 Jul 2012 12:47:06 +0200 Subject: s3:waf: add Darwin sendfile() test --- source3/wscript | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'source3/wscript') diff --git a/source3/wscript b/source3/wscript index 91ffc2599a7..0be9a431544 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 + #include + #include + 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 -- cgit