summaryrefslogtreecommitdiff
path: root/source3/configure.in
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-09-17 01:10:47 +0000
committerJeremy Allison <jra@samba.org>2002-09-17 01:10:47 +0000
commite8ea0aadbb01d824851dfbf2e9122170791b7226 (patch)
treec1641a321c63867c5545c50d99fb2c4a791a2cb9 /source3/configure.in
parentf74086ccf09e8157419f7c51490dc31effb6ba20 (diff)
downloadsamba-e8ea0aadbb01d824851dfbf2e9122170791b7226.tar.gz
samba-e8ea0aadbb01d824851dfbf2e9122170791b7226.tar.bz2
samba-e8ea0aadbb01d824851dfbf2e9122170791b7226.zip
Added FreeBSD sendfile configure tests. Richard please test...
Jeremy. (This used to be commit 6425f169779ce65509b77cf6d5634de24894a965)
Diffstat (limited to 'source3/configure.in')
-rw-r--r--source3/configure.in33
1 files changed, 31 insertions, 2 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 8f3a06b0cd..5e742f9498 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -2672,7 +2672,7 @@ AC_ARG_WITH(sendfile-support,
case "$host_os" in
*linux*)
- AC_CACHE_CHECK([for sendfile64 support],samba_cv_HAVE_SENDFILE64,[
+ AC_CACHE_CHECK([for linux sendfile64 support],samba_cv_HAVE_SENDFILE64,[
AC_TRY_LINK([#include <sys/sendfile.h>],
[\
int tofd, fromfd;
@@ -2682,7 +2682,7 @@ ssize_t nwritten = sendfile64(tofd, fromfd, &offset, total);
],
samba_cv_HAVE_SENDFILE64=yes,samba_cv_HAVE_SENDFILE64=no)])
- AC_CACHE_CHECK([for sendfile support],samba_cv_HAVE_SENDFILE,[
+ AC_CACHE_CHECK([for linux sendfile support],samba_cv_HAVE_SENDFILE,[
AC_TRY_LINK([#include <sys/sendfile.h>],
[\
int tofd, fromfd;
@@ -2723,6 +2723,35 @@ samba_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,samba_cv_HAVE_BROKEN_LINUX_SENDFILE=no)]
fi
;;
+ *freebsd*)
+ AC_CACHE_CHECK([for freebsd sendfile support],samba_cv_HAVE_SENDFILE,[
+ AC_TRY_LINK([\
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/uio.h>],
+[\
+ int fromfd, tofd;
+ 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;
+ int ret = sendfile(fromfd, tofd, offset, total, &hdr, &nwritten, 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)
+ AC_DEFINE(FREEBSD_SENDFILE_API)
+ AC_DEFINE(WITH_SENDFILE)
+ else
+ AC_MSG_RESULT(no);
+ fi
+ ;;
*)
;;
esac