aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2017-11-22 14:12:55 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2017-11-22 14:45:50 +0300
commite28049cccb0d25cf5d93436c7db431f4d147ac59 (patch)
treeba98d321ab730656b2d31b88404218fbfbddab1a /configure.ac
parent79245407f429a1e10f44452b3a3b10e02a104c7d (diff)
downloadlibmicrohttpd-e28049cccb0d25cf5d93436c7db431f4d147ac59.tar.gz
libmicrohttpd-e28049cccb0d25cf5d93436c7db431f4d147ac59.zip
Added support for Darwin-style sendfile()
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac40
1 files changed, 40 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index ca336ab7..625b74ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1311,6 +1311,46 @@ int sendfile(int, int, off_t, size_t,
1311 ) 1311 )
1312 ] 1312 ]
1313) 1313)
1314AS_VAR_IF([[found_sendfile]], [["no"]],
1315 [
1316 AC_MSG_CHECKING([[for Darwin-style sendfile(2)]])
1317 AC_LINK_IFELSE(
1318 [AC_LANG_PROGRAM(
1319 [[
1320#include <sys/types.h>
1321#include <sys/socket.h>
1322#include <sys/uio.h>
1323
1324static void empty_func(void)
1325{
1326/* Check for declaration */
1327 (void)sendfile;
1328}
1329/* Declare again to check form match */
1330int sendfile(int, int, off_t, off_t*,
1331 struct sf_hdtr *, int);
1332 ]],
1333 [[
1334 int fd=0, s=1;
1335 off_t o = 0;
1336 off_t l = 5;
1337 int r;
1338 r = sendfile (fd, s, o, &l, (void*)0, 0);
1339 if (r)
1340 empty_func();
1341 ]]
1342 )
1343 ],
1344 [
1345 AC_DEFINE([HAVE_DARWIN_SENDFILE], [1], [Define to 1 if you have Darwin-style sendfile(2).])
1346 found_sendfile="yes, Darwin-style"
1347 AC_MSG_RESULT([[yes]])
1348 ],
1349 [AC_MSG_RESULT([[no]])
1350 ]
1351 )
1352 ]
1353)
1314 1354
1315AS_VAR_IF([[found_sendfile]], [["no"]], 1355AS_VAR_IF([[found_sendfile]], [["no"]],
1316 [ 1356 [