From 2babc4fcf47ad865e301ce22cceff4e0b0429de9 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 22 Feb 2011 21:16:39 +0100 Subject: s3-waf: add check for sendfile on freebsd. Guenther --- source3/wscript | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'source3/wscript') diff --git a/source3/wscript b/source3/wscript index 50e2ec17bd..99dcb5d9f0 100644 --- a/source3/wscript +++ b/source3/wscript @@ -1342,6 +1342,30 @@ main() { elif conf.CONFIG_SET('_HAVE_BROKEN_LINUX_SENDFILE'): conf.DEFINE('LINUX_BROKEN_SENDFILE_API', '1') conf.DEFINE('WITH_SENDFILE', '1') + elif (host_os.rfind('freebsd') > -1) or (host_os.rfind('dragonfly') > -1): + conf.CHECK_CODE(''' + #include + #include + #include + #include + int fromfd, tofd, ret, total=0; + off_t offset, nwritten; + struct sf_hdtr hdr; + struct iovec hdtrl; + hdr.headers = &hdtrl; + hdr.hdr_cnt = 1; + hdr.trailers = NULL; + hdr.trl_cnt = 0; + hdtrl.iov_base = NULL; + hdtrl.iov_len = 0; + ret = sendfile(fromfd, tofd, offset, total, &hdr, &nwritten, 0) + ''', + '_HAVE_SENDFILE', + msg='Checking for freebsd sendfile support') + if conf.CONFIG_SET('_HAVE_SENDFILE'): + conf.DEFINE('HAVE_SENDFILE', '1') + conf.DEFINE('FREEBSD_SENDFILE_API', '1') + conf.DEFINE('WITH_SENDFILE', '1') default_static_modules=TO_LIST('''pdb_smbpasswd pdb_tdbsam pdb_wbc_sam auth_sam auth_unix auth_winbind auth_wbc auth_server -- cgit