diff options
author | Günther Deschner <gd@samba.org> | 2011-02-22 21:16:39 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2011-02-22 21:52:19 +0100 |
commit | 2babc4fcf47ad865e301ce22cceff4e0b0429de9 (patch) | |
tree | 4f1e5bd042e4555d1b5c03e9aa8af176310651d9 /source3 | |
parent | d71c024131d4b108e5c6b4eacf5a75fef8c69215 (diff) | |
download | samba-2babc4fcf47ad865e301ce22cceff4e0b0429de9.tar.gz samba-2babc4fcf47ad865e301ce22cceff4e0b0429de9.tar.bz2 samba-2babc4fcf47ad865e301ce22cceff4e0b0429de9.zip |
s3-waf: add check for sendfile on freebsd.
Guenther
Diffstat (limited to 'source3')
-rw-r--r-- | source3/wscript | 24 |
1 files changed, 24 insertions, 0 deletions
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 <sys/types.h> + #include <unistd.h> + #include <sys/socket.h> + #include <sys/uio.h> + 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 |