From d347c8d5775261a59679bc7ecd3b5e9b5b9ccca7 Mon Sep 17 00:00:00 2001 From: Björn Jacke Date: Fri, 29 Jun 2012 20:13:57 +0200 Subject: s3:configure: add Darwin sendfile() test --- source3/configure.in | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'source3/configure.in') diff --git a/source3/configure.in b/source3/configure.in index 6a26038d68..bd21db916d 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -5649,7 +5649,39 @@ samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)]) AC_MSG_RESULT(no); fi ;; + *darwin*) + AC_CACHE_CHECK([for Darwin sendfile support], + samba_cv_HAVE_SENDFILE, + [ + AC_TRY_LINK([ +#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); + ], + samba_cv_HAVE_SENDFILE=yes, + samba_cv_HAVE_SENDFILE=no)]) + if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then + AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() support is available]) + AC_DEFINE(DARWIN_SENDFILE_API,1,[Whether the Darwin sendfile() API is available]) + AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included]) + else + AC_MSG_RESULT(no); + fi + ;; *hpux*|*osf*) AC_CACHE_CHECK([for osf/hpux sendfile support],samba_cv_HAVE_SENDFILE,[ AC_TRY_LINK([\ -- cgit