[patch] Fix configure test for sendfile()
Jonathan Wakely
jwakely@redhat.com
Wed May 25 16:14:00 GMT 2016
On 19/04/16 19:30 +0100, Jonathan Wakely wrote:
>One more fix for the Filesystem library: my configure test for the GNU
>and Solaris version of sendfile was failing because it used NULL
>without stddef.h, so we never used sendfile. That was useful, because
>it meant someone found and reported a bug in the alternative
>implementation that doesn't use sendfile, but it will be much faster
>to use sendfile when available.
>
>This fixes the configure test, but as it affects the build config I
>won't commit it until after 6.1 is released.
Committed to trunk.
>Tested x86_64-linux.
>
>commit 867bf574bad0ba186d941520c2575e8be1ea5366
>Author: Jonathan Wakely <jwakely@redhat.com>
>Date: Tue Apr 19 19:17:50 2016 +0100
>
> Fix configure test for sendfile()
>
> * acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Fix test for sendfile.
> * configure: Regenerate.
> * config.h.in: Regenerate.
>
>diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
>index b0f88cb..0824243 100644
>--- a/libstdc++-v3/acinclude.m4
>+++ b/libstdc++-v3/acinclude.m4
>@@ -4373,7 +4373,7 @@ dnl
> gnu* | linux* | solaris*)
> GCC_TRY_COMPILE_OR_LINK(
> [#include <sys/sendfile.h>],
>- [sendfile(1, 2, (off_t*)NULL, sizeof 1);],
>+ [sendfile(1, 2, (off_t*)0, sizeof 1);],
> [glibcxx_cv_sendfile=yes],
> [glibcxx_cv_sendfile=no])
> ;;
>@@ -4383,7 +4383,7 @@ dnl
> esac
> ])
> if test $glibcxx_cv_sendfile = yes; then
>- AC_DEFINE(_GLIBCXX_USE_SENDFILE, 1, [Define if sendfile is available in <sys/stat.h>.])
>+ AC_DEFINE(_GLIBCXX_USE_SENDFILE, 1, [Define if sendfile is available in <sys/sendfile.h>.])
> fi
> AC_MSG_RESULT($glibcxx_cv_sendfile)
> dnl
More information about the Libstdc++
mailing list