Commit 5492c180 authored by Dag Erling Smørgrav's avatar Dag Erling Smørgrav

Clean up some of the fallout from the Solaris patch - mostly configure

script breakage.  In particular, disable the sendfile() check, as Solaris
doesn't have a working sendfile() any more than Linux does.  Actually, the
Solaris sendfile code was never compiled or used, because the #ifdefs in
cache_pool.c were all wrong.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3338 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent e3c82859
......@@ -80,7 +80,7 @@ varnishd_LDADD = \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
$(top_builddir)/lib/libvcl/libvcl.la \
@JEMALLOC_LDADD@ \
${DL_LIBS} ${PTHREAD_LIBS} ${NET_LIBS} ${LIBM}
${DL_LIBS} ${PTHREAD_LIBS} ${NET_LIBS} ${LIBM} ${LIBUMEM}
EXTRA_DIST = default.vcl
DISTCLEANFILES = default_vcl.h
......@@ -93,4 +93,3 @@ default_vcl.h: default.vcl Makefile
# Explicitly record dependency
mgt_vcc.c: default_vcl.h
......@@ -193,8 +193,7 @@ WRK_Sendfile(struct worker *w, int fd, off_t off, unsigned len)
sendfile(*w->wfd, fd, &off, len) != len)
w->werr++;
} while (0);
#elif defined(__sun)
#ifdef HAVE_SENDFILEV
#elif defined(__sun) && defined(HAVE_SENDFILEV)
do {
sendfilevec_t svvec[HTTP_HDR_MAX * 2 + 1];
size_t xferred = 0, expected = 0;
......@@ -217,13 +216,12 @@ WRK_Sendfile(struct worker *w, int fd, off_t off, unsigned len)
w->liov = 0;
w->niov = 0;
} while (0);
#else
#elif defined(__sun) && defined(HAVE_SENDFILE)
do {
if (WRK_Flush(w) == 0 &&
sendfile(*w->wfd, fd, &off, len) != len)
w->werr++;
} while (0);
#endif
#else
#error Unknown sendfile() implementation
#endif
......
......@@ -33,7 +33,7 @@
#include "config.h"
#ifdef HAVE_UMEM_H
#ifdef HAVE_LIBUMEM
#include <sys/types.h>
......
......@@ -70,8 +70,9 @@ AC_SUBST(LIBM)
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([sys/filio.h])
AC_CHECK_HEADERS([sys/mount.h])
AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([sys/statvfs.h])
AC_CHECK_HEADERS([sys/vfs.h])
AC_CHECK_HEADERS([netinet/in.h])
......@@ -109,7 +110,8 @@ AC_CHECK_FUNCS([pthread_set_name_np])
AC_CHECK_FUNCS([pthread_mutex_isowned_np])
LIBS="${save_LIBS}"
## This one is tricky, there are multiple versions
# sendfile is tricky: there are multiple versions, and most of them
# don't work.
case $target in
*-*-freebsd*)
AC_CACHE_CHECK([whether sendfile works],
......@@ -125,28 +127,37 @@ case $target in
[ac_cv_so_sendfile_works=yes],
[ac_cv_so_sendfile_works=no])
])
if test "$ac_cv_so_sendfile_works" = yes; then
AC_DEFINE([SENDFILE_WORKS], [1], [Define if SENDFILE works])
fi
;;
;;
#*-*-solaris*)
# save_LIBS="${LIBS}"
# LIBS="${NET_LIBS}"
# AC_CHECK_LIB(sendfile, sendfile)
# AC_CHECK_FUNCS([sendfile])
# AC_CHECK_FUNCS([sendfilev])
# NET_LIBS="${LIBS}"
# LIBS="${save_LIBS}"
*)
AC_MSG_WARN([won't look for sendfile() on $target])
;;
esac
if test "$ac_cv_so_sendfile_works" = yes; then
AC_DEFINE([SENDFILE_WORKS], [1], [Define if SENDFILE works])
fi
# Userland slab allocator, available only on Solaris
case $target in
*-*-solaris*)
AC_CHECK_HEADERS([sys/filio.h])
AC_CHECK_LIB(sendfile, sendfile)
AC_CHECK_LIB(umem, malloc)
AC_CHECK_HEADERS([umem.h])
if test "$ac_cv_lib_sendfile_sendfile" = yes; then
if test "$ac_cv_have_umem_h" = yes; then
save_LIBS="${LIBS}"
LIBS="${NET_LIBS}"
AC_CHECK_FUNCS([sendfile])
AC_CHECK_FUNCS([sendfilev])
LIBS=""
AC_CHECK_LIB(umem, umem_alloc)
LIBUMEM="${LIBS}"
LIBS="${save_LIBS}"
fi
;;
*)
AC_MSG_WARN([won't look for sendfile() on $target])
;;
esac
AC_SUBST(LIBUMEM)
# These functions are provided by libcompat on platforms where they
# are not available
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment