aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac41
1 files changed, 41 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index e4b6f48e..507062c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1267,6 +1267,47 @@ ssize_t sendfile(int, int, off_t*, size_t);
1267 [AC_MSG_RESULT([[no]]) 1267 [AC_MSG_RESULT([[no]])
1268 ] 1268 ]
1269) 1269)
1270AS_VAR_IF([[found_sendfile]], [["no"]],
1271 [
1272 AC_MSG_CHECKING([[for FreeBSD-style sendfile(2)]])
1273 AC_LINK_IFELSE(
1274 [AC_LANG_PROGRAM(
1275 [[
1276#include <sys/types.h>
1277#include <sys/socket.h>
1278#include <sys/uio.h>
1279
1280static void empty_func(void)
1281{
1282/* Check for declaration */
1283 (void)sendfile;
1284}
1285/* Declare again to check form match */
1286int sendfile(int, int, off_t, size_t,
1287 struct sf_hdtr*, off_t*, int);
1288 ]],
1289 [[
1290 int fd1=0, fd2=1;
1291 off_t o = 0;
1292 size_t s = 5;
1293 off_t r1;
1294 int r2;
1295 r2 = sendfile (fd1, fd2, o, s, (void*)0, &r1, 0);
1296 if (r2)
1297 empty_func();
1298 ]]
1299 )
1300 ],
1301 [
1302 AC_DEFINE([HAVE_FREEBSD_SENDFILE], [1], [Define to 1 if you have FreeBSD-style sendfile(2).])
1303 found_sendfile="yes, FreeBSD-style"
1304 AC_MSG_RESULT([[yes]])
1305 ],
1306 [AC_MSG_RESULT([[no]])
1307 ]
1308 )
1309 ]
1310)
1270 1311
1271# optional: have error messages ? 1312# optional: have error messages ?
1272AC_MSG_CHECKING([[whether to generate error messages]]) 1313AC_MSG_CHECKING([[whether to generate error messages]])