summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/wscript24
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