From 3d96736835c69b3de698bd3cc9ed12bab1da8d73 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 17 Feb 2014 16:49:57 -0500 Subject: check for sys/sendfile.h header instead of __linux__ Non-Linux OSes may eventually gain a Linux-compatible sendfile. --- configure.ac | 2 ++ http_get.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 1911f4d..4e66f84 100644 --- a/configure.ac +++ b/configure.ac @@ -40,6 +40,8 @@ AC_CHECK_FUNCS([epoll_ctl], [HAVE_EPOLL=1], [HAVE_EPOLL=0]) AC_SUBST(HAVE_EPOLL) AM_CONDITIONAL(HAVE_EPOLL, test "x$HAVE_EPOLL" = "x1") +AC_CHECK_HEADERS([sys/sendfile.h]) + dnl libkqueue should work in the future AC_CHECK_FUNCS([kqueue]) diff --git a/http_get.c b/http_get.c index acca0df..eb6c5a8 100644 --- a/http_get.c +++ b/http_get.c @@ -6,9 +6,10 @@ #include "cmogstored.h" #include "http.h" #if defined(HAVE_SENDFILE) -# if defined(__linux__) +# ifdef HAVE_SYS_SENDFILE_H /* Linux */ # include -# else +# endif +# ifndef __linux__ /* * make BSD sendfile look like Linux for now... * we can support SF_NODISKIO later -- cgit v1.2.3-24-ge0c7