Bug 975634 - Detect posix_fadvise() via configure. r=glandium

This commit is contained in:
Jan Beich 2014-03-04 09:30:29 -05:00
parent 0571ecbb6d
commit 8e35f9b4b4
3 changed files with 3 additions and 27 deletions

View File

@ -8675,19 +8675,7 @@ fi
AC_SUBST(MOZ_EM_DEBUG)
if test -n "$COMPILE_ENVIRONMENT"; then
AC_MSG_CHECKING([for posix_fallocate])
AC_TRY_LINK([#define _XOPEN_SOURCE 600
#include <fcntl.h>],
[posix_fallocate(0, 0, 0);],
[ac_cv___posix_fallocate=true],
[ac_cv___posix_fallocate=false])
if test "$ac_cv___posix_fallocate" = true ; then
AC_DEFINE(HAVE_POSIX_FALLOCATE)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_CHECK_FUNCS(posix_fadvise posix_fallocate)
dnl Check for missing components
if test "$MOZ_X11"; then

View File

@ -4026,19 +4026,7 @@ AC_SUBST(CXX_VERSION)
AC_SUBST(MSMANIFEST_TOOL)
AC_SUBST(MOZ_LINKER)
AC_MSG_CHECKING([for posix_fallocate])
AC_TRY_LINK([#define _XOPEN_SOURCE 600
#include <fcntl.h>],
[posix_fallocate(0, 0, 0);],
[ac_cv___posix_fallocate=true],
[ac_cv___posix_fallocate=false])
if test "$ac_cv___posix_fallocate" = true ; then
AC_DEFINE(HAVE_POSIX_FALLOCATE)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_CHECK_FUNCS(posix_fadvise posix_fallocate)
dnl Check for missing components
if test "$COMPILE_ENVIRONMENT"; then

View File

@ -382,7 +382,7 @@ nsLocalFile::OpenNSPRFileDesc(int32_t flags, int32_t mode, PRFileDesc **_retval)
PR_Delete(mPath.get());
}
#if defined(LINUX) && !defined(ANDROID)
#if defined(HAVE_POSIX_FADVISE)
if (flags & OS_READAHEAD) {
posix_fadvise(PR_FileDesc2NativeHandle(*_retval), 0, 0,
POSIX_FADV_SEQUENTIAL);