summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2012-06-29 20:13:57 +0200
committerBjörn Jacke <bj@sernet.de>2012-07-26 15:18:30 +0200
commitd347c8d5775261a59679bc7ecd3b5e9b5b9ccca7 (patch)
treee43aab3f761279981eab4675c9807ec0c05acdf6
parent115a88e18f103e2191bba7ce30604086b619081b (diff)
downloadsamba-d347c8d5775261a59679bc7ecd3b5e9b5b9ccca7.tar.gz
s3:configure: add Darwin sendfile() test
-rw-r--r--source3/configure.in32
1 files changed, 32 insertions, 0 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 6a26038d688..bd21db916db 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 <sys/types.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+ ],
+ [
+ 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([\