Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Feb 2014 01:48:14 GMT
From:      svn-freebsd-gecko@chruetertee.ch
To:        freebsd-gecko@freebsd.org
Subject:   [SVN-Commit] r1506 - in trunk: mail/thunderbird/files www/firefox-esr/files www/firefox-nightly/files www/firefox/files www/libxul/files www/seamonkey/files
Message-ID:  <201402220148.s1M1mEhF063064@trillian.chruetertee.ch>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Sat Feb 22 01:48:14 2014
New Revision: 1506

Log:
detect and use posix_fadvise() since freebsd 9.1

Added:
   trunk/mail/thunderbird/files/patch-bug975634
   trunk/www/firefox-esr/files/patch-bug975634
   trunk/www/firefox-nightly/files/patch-bug975634
   trunk/www/firefox/files/patch-bug975634
   trunk/www/libxul/files/patch-bug975634
   trunk/www/seamonkey/files/patch-bug975634

Added: trunk/mail/thunderbird/files/patch-bug975634
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/mail/thunderbird/files/patch-bug975634	Sat Feb 22 01:48:14 2014	(r1506)
@@ -0,0 +1,133 @@
+diff --git configure.in configure.in
+index 0d9236a..0447104 100644
+--- mozilla/configure.in
++++ mozilla/configure.in
+@@ -9034,6 +9034,20 @@ AC_SUBST(MOZ_FOLD_LIBS)
+ AC_SUBST(MOZ_ENABLE_SZIP)
+ AC_SUBST(MOZ_SZIP_FLAGS)
+ 
++AC_MSG_CHECKING([for posix_fadvise])
++AC_TRY_LINK([#define _XOPEN_SOURCE 600
++  #include <fcntl.h>],
++                 [posix_fadvise(0, 0, 0, 0);],
++                 [ac_cv___posix_fadvise=true],
++                 [ac_cv___posix_fadvise=false])
++
++if test "$ac_cv___posix_fadvise" = true ; then
++  AC_DEFINE(HAVE_POSIX_FADVISE)
++  AC_MSG_RESULT(yes)
++else
++  AC_MSG_RESULT(no)
++fi
++
+ AC_MSG_CHECKING([for posix_fallocate])
+ AC_TRY_LINK([#define _XOPEN_SOURCE 600
+   #include <fcntl.h>],
+diff --git js/src/configure.in js/src/configure.in
+index da9767c..352ba14 100644
+--- mozilla/js/src/configure.in
++++ mozilla/js/src/configure.in
+@@ -4025,6 +4025,20 @@ AC_SUBST(CXX_VERSION)
+ AC_SUBST(MSMANIFEST_TOOL)
+ AC_SUBST(MOZ_LINKER)
+ 
++AC_MSG_CHECKING([for posix_fadvise])
++AC_TRY_LINK([#define _XOPEN_SOURCE 600
++  #include <fcntl.h>],
++                 [posix_fadvise(0, 0, 0, 0);],
++                 [ac_cv___posix_fadvise=true],
++                 [ac_cv___posix_fadvise=false])
++
++if test "$ac_cv___posix_fadvise" = true ; then
++  AC_DEFINE(HAVE_POSIX_FADVISE)
++  AC_MSG_RESULT(yes)
++else
++  AC_MSG_RESULT(no)
++fi
++
+ AC_MSG_CHECKING([for posix_fallocate])
+ AC_TRY_LINK([#define _XOPEN_SOURCE 600
+   #include <fcntl.h>],
+diff --git xpcom/glue/FileUtils.cpp xpcom/glue/FileUtils.cpp
+index 66fe9e9..8bdf8f4 100644
+--- mozilla/xpcom/glue/FileUtils.cpp
++++ mozilla/xpcom/glue/FileUtils.cpp
+@@ -24,7 +24,7 @@
+ #elif defined(XP_UNIX)
+ #include <fcntl.h>
+ #include <unistd.h>
+-#if defined(LINUX)
++#if defined(HAVE_POSIX_FADVISE)
+ #include <elf.h>
+ #endif
+ #include <sys/types.h>
+@@ -185,7 +185,7 @@ mozilla::ReadAheadLib(nsIFile* aFile)
+     return;
+   }
+   ReadAheadLib(path.get());
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   nsAutoCString nativePath;
+   if (!aFile || NS_FAILED(aFile->GetNativePath(nativePath))) {
+     return;
+@@ -204,7 +204,7 @@ mozilla::ReadAheadFile(nsIFile* aFile, const size_t aOffset,
+     return;
+   }
+   ReadAheadFile(path.get(), aOffset, aCount, aOutFd);
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   nsAutoCString nativePath;
+   if (!aFile || NS_FAILED(aFile->GetNativePath(nativePath))) {
+     return;
+@@ -215,7 +215,7 @@ mozilla::ReadAheadFile(nsIFile* aFile, const size_t aOffset,
+ 
+ #endif // !defined(XPCOM_GLUE)
+ 
+-#if defined(LINUX) && !defined(ANDROID)
++#if defined(HAVE_POSIX_FADVISE)
+ 
+ static const unsigned int bufsize = 4096;
+ 
+@@ -341,9 +341,9 @@ mozilla::ReadAhead(mozilla::filedesc_t aFd, const size_t aOffset,
+   // Restore the file pointer
+   SetFilePointerEx(aFd, fpOriginal, nullptr, FILE_BEGIN);
+ 
+-#elif defined(LINUX) && !defined(ANDROID)
++#elif defined(HAVE_POSIX_FADVISE)
+ 
+-  readahead(aFd, aOffset, aCount);
++  posix_fadvise(aFd, aOffset, aCount, POSIX_FADV_WILLNEED);
+ 
+ #elif defined(XP_MACOSX)
+ 
+@@ -364,7 +364,7 @@ mozilla::ReadAheadLib(mozilla::pathstr_t aFilePath)
+   }
+ #if defined(XP_WIN)
+   ReadAheadFile(aFilePath);
+-#elif defined(LINUX) && !defined(ANDROID)
++#elif defined(HAVE_POSIX_FADVISE)
+   int fd = open(aFilePath, O_RDONLY);
+   if (fd < 0) {
+     return;
+@@ -486,7 +486,7 @@ mozilla::ReadAheadFile(mozilla::pathstr_t aFilePath, const size_t aOffset,
+   if (!aOutFd) {
+     CloseHandle(fd);
+   }
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   if (!aFilePath) {
+     if (aOutFd) {
+       *aOutFd = -1;
+diff --git xpcom/io/nsLocalFileUnix.cpp xpcom/io/nsLocalFileUnix.cpp
+index bacf06c..0e46e4a 100644
+--- mozilla/xpcom/io/nsLocalFileUnix.cpp
++++ mozilla/xpcom/io/nsLocalFileUnix.cpp
+@@ -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);

Added: trunk/www/firefox-esr/files/patch-bug975634
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/www/firefox-esr/files/patch-bug975634	Sat Feb 22 01:48:14 2014	(r1506)
@@ -0,0 +1,133 @@
+diff --git configure.in configure.in
+index 0d9236a..0447104 100644
+--- configure.in
++++ configure.in
+@@ -9034,6 +9034,20 @@ AC_SUBST(MOZ_FOLD_LIBS)
+ AC_SUBST(MOZ_ENABLE_SZIP)
+ AC_SUBST(MOZ_SZIP_FLAGS)
+ 
++AC_MSG_CHECKING([for posix_fadvise])
++AC_TRY_LINK([#define _XOPEN_SOURCE 600
++  #include <fcntl.h>],
++                 [posix_fadvise(0, 0, 0, 0);],
++                 [ac_cv___posix_fadvise=true],
++                 [ac_cv___posix_fadvise=false])
++
++if test "$ac_cv___posix_fadvise" = true ; then
++  AC_DEFINE(HAVE_POSIX_FADVISE)
++  AC_MSG_RESULT(yes)
++else
++  AC_MSG_RESULT(no)
++fi
++
+ AC_MSG_CHECKING([for posix_fallocate])
+ AC_TRY_LINK([#define _XOPEN_SOURCE 600
+   #include <fcntl.h>],
+diff --git js/src/configure.in js/src/configure.in
+index da9767c..352ba14 100644
+--- js/src/configure.in
++++ js/src/configure.in
+@@ -4025,6 +4025,20 @@ AC_SUBST(CXX_VERSION)
+ AC_SUBST(MSMANIFEST_TOOL)
+ AC_SUBST(MOZ_LINKER)
+ 
++AC_MSG_CHECKING([for posix_fadvise])
++AC_TRY_LINK([#define _XOPEN_SOURCE 600
++  #include <fcntl.h>],
++                 [posix_fadvise(0, 0, 0, 0);],
++                 [ac_cv___posix_fadvise=true],
++                 [ac_cv___posix_fadvise=false])
++
++if test "$ac_cv___posix_fadvise" = true ; then
++  AC_DEFINE(HAVE_POSIX_FADVISE)
++  AC_MSG_RESULT(yes)
++else
++  AC_MSG_RESULT(no)
++fi
++
+ AC_MSG_CHECKING([for posix_fallocate])
+ AC_TRY_LINK([#define _XOPEN_SOURCE 600
+   #include <fcntl.h>],
+diff --git xpcom/glue/FileUtils.cpp xpcom/glue/FileUtils.cpp
+index 66fe9e9..8bdf8f4 100644
+--- xpcom/glue/FileUtils.cpp
++++ xpcom/glue/FileUtils.cpp
+@@ -24,7 +24,7 @@
+ #elif defined(XP_UNIX)
+ #include <fcntl.h>
+ #include <unistd.h>
+-#if defined(LINUX)
++#if defined(HAVE_POSIX_FADVISE)
+ #include <elf.h>
+ #endif
+ #include <sys/types.h>
+@@ -185,7 +185,7 @@ mozilla::ReadAheadLib(nsIFile* aFile)
+     return;
+   }
+   ReadAheadLib(path.get());
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   nsAutoCString nativePath;
+   if (!aFile || NS_FAILED(aFile->GetNativePath(nativePath))) {
+     return;
+@@ -204,7 +204,7 @@ mozilla::ReadAheadFile(nsIFile* aFile, const size_t aOffset,
+     return;
+   }
+   ReadAheadFile(path.get(), aOffset, aCount, aOutFd);
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   nsAutoCString nativePath;
+   if (!aFile || NS_FAILED(aFile->GetNativePath(nativePath))) {
+     return;
+@@ -215,7 +215,7 @@ mozilla::ReadAheadFile(nsIFile* aFile, const size_t aOffset,
+ 
+ #endif // !defined(XPCOM_GLUE)
+ 
+-#if defined(LINUX) && !defined(ANDROID)
++#if defined(HAVE_POSIX_FADVISE)
+ 
+ static const unsigned int bufsize = 4096;
+ 
+@@ -341,9 +341,9 @@ mozilla::ReadAhead(mozilla::filedesc_t aFd, const size_t aOffset,
+   // Restore the file pointer
+   SetFilePointerEx(aFd, fpOriginal, nullptr, FILE_BEGIN);
+ 
+-#elif defined(LINUX) && !defined(ANDROID)
++#elif defined(HAVE_POSIX_FADVISE)
+ 
+-  readahead(aFd, aOffset, aCount);
++  posix_fadvise(aFd, aOffset, aCount, POSIX_FADV_WILLNEED);
+ 
+ #elif defined(XP_MACOSX)
+ 
+@@ -364,7 +364,7 @@ mozilla::ReadAheadLib(mozilla::pathstr_t aFilePath)
+   }
+ #if defined(XP_WIN)
+   ReadAheadFile(aFilePath);
+-#elif defined(LINUX) && !defined(ANDROID)
++#elif defined(HAVE_POSIX_FADVISE)
+   int fd = open(aFilePath, O_RDONLY);
+   if (fd < 0) {
+     return;
+@@ -486,7 +486,7 @@ mozilla::ReadAheadFile(mozilla::pathstr_t aFilePath, const size_t aOffset,
+   if (!aOutFd) {
+     CloseHandle(fd);
+   }
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   if (!aFilePath) {
+     if (aOutFd) {
+       *aOutFd = -1;
+diff --git xpcom/io/nsLocalFileUnix.cpp xpcom/io/nsLocalFileUnix.cpp
+index bacf06c..0e46e4a 100644
+--- xpcom/io/nsLocalFileUnix.cpp
++++ xpcom/io/nsLocalFileUnix.cpp
+@@ -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);

Added: trunk/www/firefox-nightly/files/patch-bug975634
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/www/firefox-nightly/files/patch-bug975634	Sat Feb 22 01:48:14 2014	(r1506)
@@ -0,0 +1,133 @@
+diff --git configure.in configure.in
+index 0d9236a..0447104 100644
+--- configure.in
++++ configure.in
+@@ -8670,6 +8670,20 @@ fi
+ AC_SUBST(MOZ_EM_DEBUG)
+ 
+ if test -n "$COMPILE_ENVIRONMENT"; then
++AC_MSG_CHECKING([for posix_fadvise])
++AC_TRY_LINK([#define _XOPEN_SOURCE 600
++  #include <fcntl.h>],
++                 [posix_fadvise(0, 0, 0, 0);],
++                 [ac_cv___posix_fadvise=true],
++                 [ac_cv___posix_fadvise=false])
++
++if test "$ac_cv___posix_fadvise" = true ; then
++  AC_DEFINE(HAVE_POSIX_FADVISE)
++  AC_MSG_RESULT(yes)
++else
++  AC_MSG_RESULT(no)
++fi
++
+ AC_MSG_CHECKING([for posix_fallocate])
+ AC_TRY_LINK([#define _XOPEN_SOURCE 600
+   #include <fcntl.h>],
+diff --git js/src/configure.in js/src/configure.in
+index da9767c..352ba14 100644
+--- js/src/configure.in
++++ js/src/configure.in
+@@ -4025,6 +4025,20 @@ AC_SUBST(CXX_VERSION)
+ AC_SUBST(MSMANIFEST_TOOL)
+ AC_SUBST(MOZ_LINKER)
+ 
++AC_MSG_CHECKING([for posix_fadvise])
++AC_TRY_LINK([#define _XOPEN_SOURCE 600
++  #include <fcntl.h>],
++                 [posix_fadvise(0, 0, 0, 0);],
++                 [ac_cv___posix_fadvise=true],
++                 [ac_cv___posix_fadvise=false])
++
++if test "$ac_cv___posix_fadvise" = true ; then
++  AC_DEFINE(HAVE_POSIX_FADVISE)
++  AC_MSG_RESULT(yes)
++else
++  AC_MSG_RESULT(no)
++fi
++
+ AC_MSG_CHECKING([for posix_fallocate])
+ AC_TRY_LINK([#define _XOPEN_SOURCE 600
+   #include <fcntl.h>],
+diff --git xpcom/glue/FileUtils.cpp xpcom/glue/FileUtils.cpp
+index 66fe9e9..8bdf8f4 100644
+--- xpcom/glue/FileUtils.cpp
++++ xpcom/glue/FileUtils.cpp
+@@ -24,7 +24,7 @@
+ #elif defined(XP_UNIX)
+ #include <fcntl.h>
+ #include <unistd.h>
+-#if defined(LINUX)
++#if defined(HAVE_POSIX_FADVISE)
+ #include <elf.h>
+ #endif
+ #include <sys/types.h>
+@@ -185,7 +185,7 @@ mozilla::ReadAheadLib(nsIFile* aFile)
+     return;
+   }
+   ReadAheadLib(path.get());
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   nsAutoCString nativePath;
+   if (!aFile || NS_FAILED(aFile->GetNativePath(nativePath))) {
+     return;
+@@ -204,7 +204,7 @@ mozilla::ReadAheadFile(nsIFile* aFile, const size_t aOffset,
+     return;
+   }
+   ReadAheadFile(path.get(), aOffset, aCount, aOutFd);
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   nsAutoCString nativePath;
+   if (!aFile || NS_FAILED(aFile->GetNativePath(nativePath))) {
+     return;
+@@ -215,7 +215,7 @@ mozilla::ReadAheadFile(nsIFile* aFile, const size_t aOffset,
+ 
+ #endif // !defined(XPCOM_GLUE)
+ 
+-#if defined(LINUX) && !defined(ANDROID)
++#if defined(HAVE_POSIX_FADVISE)
+ 
+ static const unsigned int bufsize = 4096;
+ 
+@@ -341,9 +341,9 @@ mozilla::ReadAhead(mozilla::filedesc_t aFd, const size_t aOffset,
+   // Restore the file pointer
+   SetFilePointerEx(aFd, fpOriginal, nullptr, FILE_BEGIN);
+ 
+-#elif defined(LINUX) && !defined(ANDROID)
++#elif defined(HAVE_POSIX_FADVISE)
+ 
+-  readahead(aFd, aOffset, aCount);
++  posix_fadvise(aFd, aOffset, aCount, POSIX_FADV_WILLNEED);
+ 
+ #elif defined(XP_MACOSX)
+ 
+@@ -364,7 +364,7 @@ mozilla::ReadAheadLib(mozilla::pathstr_t aFilePath)
+   }
+ #if defined(XP_WIN)
+   ReadAheadFile(aFilePath);
+-#elif defined(LINUX) && !defined(ANDROID)
++#elif defined(HAVE_POSIX_FADVISE)
+   int fd = open(aFilePath, O_RDONLY);
+   if (fd < 0) {
+     return;
+@@ -486,7 +486,7 @@ mozilla::ReadAheadFile(mozilla::pathstr_t aFilePath, const size_t aOffset,
+   if (!aOutFd) {
+     CloseHandle(fd);
+   }
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   if (!aFilePath) {
+     if (aOutFd) {
+       *aOutFd = -1;
+diff --git xpcom/io/nsLocalFileUnix.cpp xpcom/io/nsLocalFileUnix.cpp
+index bacf06c..0e46e4a 100644
+--- xpcom/io/nsLocalFileUnix.cpp
++++ xpcom/io/nsLocalFileUnix.cpp
+@@ -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);

Added: trunk/www/firefox/files/patch-bug975634
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/www/firefox/files/patch-bug975634	Sat Feb 22 01:48:14 2014	(r1506)
@@ -0,0 +1,133 @@
+diff --git configure.in configure.in
+index 0d9236a..0447104 100644
+--- configure.in
++++ configure.in
+@@ -8670,6 +8670,20 @@ fi
+ AC_SUBST(MOZ_EM_DEBUG)
+ 
+ if test -n "$COMPILE_ENVIRONMENT"; then
++AC_MSG_CHECKING([for posix_fadvise])
++AC_TRY_LINK([#define _XOPEN_SOURCE 600
++  #include <fcntl.h>],
++                 [posix_fadvise(0, 0, 0, 0);],
++                 [ac_cv___posix_fadvise=true],
++                 [ac_cv___posix_fadvise=false])
++
++if test "$ac_cv___posix_fadvise" = true ; then
++  AC_DEFINE(HAVE_POSIX_FADVISE)
++  AC_MSG_RESULT(yes)
++else
++  AC_MSG_RESULT(no)
++fi
++
+ AC_MSG_CHECKING([for posix_fallocate])
+ AC_TRY_LINK([#define _XOPEN_SOURCE 600
+   #include <fcntl.h>],
+diff --git js/src/configure.in js/src/configure.in
+index da9767c..352ba14 100644
+--- js/src/configure.in
++++ js/src/configure.in
+@@ -4025,6 +4025,20 @@ AC_SUBST(CXX_VERSION)
+ AC_SUBST(MSMANIFEST_TOOL)
+ AC_SUBST(MOZ_LINKER)
+ 
++AC_MSG_CHECKING([for posix_fadvise])
++AC_TRY_LINK([#define _XOPEN_SOURCE 600
++  #include <fcntl.h>],
++                 [posix_fadvise(0, 0, 0, 0);],
++                 [ac_cv___posix_fadvise=true],
++                 [ac_cv___posix_fadvise=false])
++
++if test "$ac_cv___posix_fadvise" = true ; then
++  AC_DEFINE(HAVE_POSIX_FADVISE)
++  AC_MSG_RESULT(yes)
++else
++  AC_MSG_RESULT(no)
++fi
++
+ AC_MSG_CHECKING([for posix_fallocate])
+ AC_TRY_LINK([#define _XOPEN_SOURCE 600
+   #include <fcntl.h>],
+diff --git xpcom/glue/FileUtils.cpp xpcom/glue/FileUtils.cpp
+index 66fe9e9..8bdf8f4 100644
+--- xpcom/glue/FileUtils.cpp
++++ xpcom/glue/FileUtils.cpp
+@@ -24,7 +24,7 @@
+ #elif defined(XP_UNIX)
+ #include <fcntl.h>
+ #include <unistd.h>
+-#if defined(LINUX)
++#if defined(HAVE_POSIX_FADVISE)
+ #include <elf.h>
+ #endif
+ #include <sys/types.h>
+@@ -185,7 +185,7 @@ mozilla::ReadAheadLib(nsIFile* aFile)
+     return;
+   }
+   ReadAheadLib(path.get());
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   nsAutoCString nativePath;
+   if (!aFile || NS_FAILED(aFile->GetNativePath(nativePath))) {
+     return;
+@@ -204,7 +204,7 @@ mozilla::ReadAheadFile(nsIFile* aFile, const size_t aOffset,
+     return;
+   }
+   ReadAheadFile(path.get(), aOffset, aCount, aOutFd);
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   nsAutoCString nativePath;
+   if (!aFile || NS_FAILED(aFile->GetNativePath(nativePath))) {
+     return;
+@@ -215,7 +215,7 @@ mozilla::ReadAheadFile(nsIFile* aFile, const size_t aOffset,
+ 
+ #endif // !defined(XPCOM_GLUE)
+ 
+-#if defined(LINUX) && !defined(ANDROID)
++#if defined(HAVE_POSIX_FADVISE)
+ 
+ static const unsigned int bufsize = 4096;
+ 
+@@ -341,9 +341,9 @@ mozilla::ReadAhead(mozilla::filedesc_t aFd, const size_t aOffset,
+   // Restore the file pointer
+   SetFilePointerEx(aFd, fpOriginal, nullptr, FILE_BEGIN);
+ 
+-#elif defined(LINUX) && !defined(ANDROID)
++#elif defined(HAVE_POSIX_FADVISE)
+ 
+-  readahead(aFd, aOffset, aCount);
++  posix_fadvise(aFd, aOffset, aCount, POSIX_FADV_WILLNEED);
+ 
+ #elif defined(XP_MACOSX)
+ 
+@@ -364,7 +364,7 @@ mozilla::ReadAheadLib(mozilla::pathstr_t aFilePath)
+   }
+ #if defined(XP_WIN)
+   ReadAheadFile(aFilePath);
+-#elif defined(LINUX) && !defined(ANDROID)
++#elif defined(HAVE_POSIX_FADVISE)
+   int fd = open(aFilePath, O_RDONLY);
+   if (fd < 0) {
+     return;
+@@ -486,7 +486,7 @@ mozilla::ReadAheadFile(mozilla::pathstr_t aFilePath, const size_t aOffset,
+   if (!aOutFd) {
+     CloseHandle(fd);
+   }
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   if (!aFilePath) {
+     if (aOutFd) {
+       *aOutFd = -1;
+diff --git xpcom/io/nsLocalFileUnix.cpp xpcom/io/nsLocalFileUnix.cpp
+index bacf06c..0e46e4a 100644
+--- xpcom/io/nsLocalFileUnix.cpp
++++ xpcom/io/nsLocalFileUnix.cpp
+@@ -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);

Added: trunk/www/libxul/files/patch-bug975634
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/www/libxul/files/patch-bug975634	Sat Feb 22 01:48:14 2014	(r1506)
@@ -0,0 +1,133 @@
+diff --git configure.in configure.in
+index 0d9236a..0447104 100644
+--- configure.in
++++ configure.in
+@@ -9034,6 +9034,20 @@ AC_SUBST(MOZ_FOLD_LIBS)
+ AC_SUBST(MOZ_ENABLE_SZIP)
+ AC_SUBST(MOZ_SZIP_FLAGS)
+ 
++AC_MSG_CHECKING([for posix_fadvise])
++AC_TRY_LINK([#define _XOPEN_SOURCE 600
++  #include <fcntl.h>],
++                 [posix_fadvise(0, 0, 0, 0);],
++                 [ac_cv___posix_fadvise=true],
++                 [ac_cv___posix_fadvise=false])
++
++if test "$ac_cv___posix_fadvise" = true ; then
++  AC_DEFINE(HAVE_POSIX_FADVISE)
++  AC_MSG_RESULT(yes)
++else
++  AC_MSG_RESULT(no)
++fi
++
+ AC_MSG_CHECKING([for posix_fallocate])
+ AC_TRY_LINK([#define _XOPEN_SOURCE 600
+   #include <fcntl.h>],
+diff --git js/src/configure.in js/src/configure.in
+index da9767c..352ba14 100644
+--- js/src/configure.in
++++ js/src/configure.in
+@@ -4025,6 +4025,20 @@ AC_SUBST(CXX_VERSION)
+ AC_SUBST(MSMANIFEST_TOOL)
+ AC_SUBST(MOZ_LINKER)
+ 
++AC_MSG_CHECKING([for posix_fadvise])
++AC_TRY_LINK([#define _XOPEN_SOURCE 600
++  #include <fcntl.h>],
++                 [posix_fadvise(0, 0, 0, 0);],
++                 [ac_cv___posix_fadvise=true],
++                 [ac_cv___posix_fadvise=false])
++
++if test "$ac_cv___posix_fadvise" = true ; then
++  AC_DEFINE(HAVE_POSIX_FADVISE)
++  AC_MSG_RESULT(yes)
++else
++  AC_MSG_RESULT(no)
++fi
++
+ AC_MSG_CHECKING([for posix_fallocate])
+ AC_TRY_LINK([#define _XOPEN_SOURCE 600
+   #include <fcntl.h>],
+diff --git xpcom/glue/FileUtils.cpp xpcom/glue/FileUtils.cpp
+index 66fe9e9..8bdf8f4 100644
+--- xpcom/glue/FileUtils.cpp
++++ xpcom/glue/FileUtils.cpp
+@@ -24,7 +24,7 @@
+ #elif defined(XP_UNIX)
+ #include <fcntl.h>
+ #include <unistd.h>
+-#if defined(LINUX)
++#if defined(HAVE_POSIX_FADVISE)
+ #include <elf.h>
+ #endif
+ #include <sys/types.h>
+@@ -185,7 +185,7 @@ mozilla::ReadAheadLib(nsIFile* aFile)
+     return;
+   }
+   ReadAheadLib(path.get());
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   nsAutoCString nativePath;
+   if (!aFile || NS_FAILED(aFile->GetNativePath(nativePath))) {
+     return;
+@@ -204,7 +204,7 @@ mozilla::ReadAheadFile(nsIFile* aFile, const size_t aOffset,
+     return;
+   }
+   ReadAheadFile(path.get(), aOffset, aCount, aOutFd);
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   nsAutoCString nativePath;
+   if (!aFile || NS_FAILED(aFile->GetNativePath(nativePath))) {
+     return;
+@@ -215,7 +215,7 @@ mozilla::ReadAheadFile(nsIFile* aFile, const size_t aOffset,
+ 
+ #endif // !defined(XPCOM_GLUE)
+ 
+-#if defined(LINUX) && !defined(ANDROID)
++#if defined(HAVE_POSIX_FADVISE)
+ 
+ static const unsigned int bufsize = 4096;
+ 
+@@ -341,9 +341,9 @@ mozilla::ReadAhead(mozilla::filedesc_t aFd, const size_t aOffset,
+   // Restore the file pointer
+   SetFilePointerEx(aFd, fpOriginal, nullptr, FILE_BEGIN);
+ 
+-#elif defined(LINUX) && !defined(ANDROID)
++#elif defined(HAVE_POSIX_FADVISE)
+ 
+-  readahead(aFd, aOffset, aCount);
++  posix_fadvise(aFd, aOffset, aCount, POSIX_FADV_WILLNEED);
+ 
+ #elif defined(XP_MACOSX)
+ 
+@@ -364,7 +364,7 @@ mozilla::ReadAheadLib(mozilla::pathstr_t aFilePath)
+   }
+ #if defined(XP_WIN)
+   ReadAheadFile(aFilePath);
+-#elif defined(LINUX) && !defined(ANDROID)
++#elif defined(HAVE_POSIX_FADVISE)
+   int fd = open(aFilePath, O_RDONLY);
+   if (fd < 0) {
+     return;
+@@ -486,7 +486,7 @@ mozilla::ReadAheadFile(mozilla::pathstr_t aFilePath, const size_t aOffset,
+   if (!aOutFd) {
+     CloseHandle(fd);
+   }
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   if (!aFilePath) {
+     if (aOutFd) {
+       *aOutFd = -1;
+diff --git xpcom/io/nsLocalFileUnix.cpp xpcom/io/nsLocalFileUnix.cpp
+index bacf06c..0e46e4a 100644
+--- xpcom/io/nsLocalFileUnix.cpp
++++ xpcom/io/nsLocalFileUnix.cpp
+@@ -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);

Added: trunk/www/seamonkey/files/patch-bug975634
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/www/seamonkey/files/patch-bug975634	Sat Feb 22 01:48:14 2014	(r1506)
@@ -0,0 +1,133 @@
+diff --git configure.in configure.in
+index 0d9236a..0447104 100644
+--- mozilla/configure.in
++++ mozilla/configure.in
+@@ -8670,6 +8670,20 @@ fi
+ AC_SUBST(MOZ_EM_DEBUG)
+ 
+ if test -n "$COMPILE_ENVIRONMENT"; then
++AC_MSG_CHECKING([for posix_fadvise])
++AC_TRY_LINK([#define _XOPEN_SOURCE 600
++  #include <fcntl.h>],
++                 [posix_fadvise(0, 0, 0, 0);],
++                 [ac_cv___posix_fadvise=true],
++                 [ac_cv___posix_fadvise=false])
++
++if test "$ac_cv___posix_fadvise" = true ; then
++  AC_DEFINE(HAVE_POSIX_FADVISE)
++  AC_MSG_RESULT(yes)
++else
++  AC_MSG_RESULT(no)
++fi
++
+ AC_MSG_CHECKING([for posix_fallocate])
+ AC_TRY_LINK([#define _XOPEN_SOURCE 600
+   #include <fcntl.h>],
+diff --git js/src/configure.in js/src/configure.in
+index da9767c..352ba14 100644
+--- mozilla/js/src/configure.in
++++ mozilla/js/src/configure.in
+@@ -4025,6 +4025,20 @@ AC_SUBST(CXX_VERSION)
+ AC_SUBST(MSMANIFEST_TOOL)
+ AC_SUBST(MOZ_LINKER)
+ 
++AC_MSG_CHECKING([for posix_fadvise])
++AC_TRY_LINK([#define _XOPEN_SOURCE 600
++  #include <fcntl.h>],
++                 [posix_fadvise(0, 0, 0, 0);],
++                 [ac_cv___posix_fadvise=true],
++                 [ac_cv___posix_fadvise=false])
++
++if test "$ac_cv___posix_fadvise" = true ; then
++  AC_DEFINE(HAVE_POSIX_FADVISE)
++  AC_MSG_RESULT(yes)
++else
++  AC_MSG_RESULT(no)
++fi
++
+ AC_MSG_CHECKING([for posix_fallocate])
+ AC_TRY_LINK([#define _XOPEN_SOURCE 600
+   #include <fcntl.h>],
+diff --git xpcom/glue/FileUtils.cpp xpcom/glue/FileUtils.cpp
+index 66fe9e9..8bdf8f4 100644
+--- mozilla/xpcom/glue/FileUtils.cpp
++++ mozilla/xpcom/glue/FileUtils.cpp
+@@ -24,7 +24,7 @@
+ #elif defined(XP_UNIX)
+ #include <fcntl.h>
+ #include <unistd.h>
+-#if defined(LINUX)
++#if defined(HAVE_POSIX_FADVISE)
+ #include <elf.h>
+ #endif
+ #include <sys/types.h>
+@@ -185,7 +185,7 @@ mozilla::ReadAheadLib(nsIFile* aFile)
+     return;
+   }
+   ReadAheadLib(path.get());
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   nsAutoCString nativePath;
+   if (!aFile || NS_FAILED(aFile->GetNativePath(nativePath))) {
+     return;
+@@ -204,7 +204,7 @@ mozilla::ReadAheadFile(nsIFile* aFile, const size_t aOffset,
+     return;
+   }
+   ReadAheadFile(path.get(), aOffset, aCount, aOutFd);
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   nsAutoCString nativePath;
+   if (!aFile || NS_FAILED(aFile->GetNativePath(nativePath))) {
+     return;
+@@ -215,7 +215,7 @@ mozilla::ReadAheadFile(nsIFile* aFile, const size_t aOffset,
+ 
+ #endif // !defined(XPCOM_GLUE)
+ 
+-#if defined(LINUX) && !defined(ANDROID)
++#if defined(HAVE_POSIX_FADVISE)
+ 
+ static const unsigned int bufsize = 4096;
+ 
+@@ -341,9 +341,9 @@ mozilla::ReadAhead(mozilla::filedesc_t aFd, const size_t aOffset,
+   // Restore the file pointer
+   SetFilePointerEx(aFd, fpOriginal, nullptr, FILE_BEGIN);
+ 
+-#elif defined(LINUX) && !defined(ANDROID)
++#elif defined(HAVE_POSIX_FADVISE)
+ 
+-  readahead(aFd, aOffset, aCount);
++  posix_fadvise(aFd, aOffset, aCount, POSIX_FADV_WILLNEED);
+ 
+ #elif defined(XP_MACOSX)
+ 
+@@ -364,7 +364,7 @@ mozilla::ReadAheadLib(mozilla::pathstr_t aFilePath)
+   }
+ #if defined(XP_WIN)
+   ReadAheadFile(aFilePath);
+-#elif defined(LINUX) && !defined(ANDROID)
++#elif defined(HAVE_POSIX_FADVISE)
+   int fd = open(aFilePath, O_RDONLY);
+   if (fd < 0) {
+     return;
+@@ -486,7 +486,7 @@ mozilla::ReadAheadFile(mozilla::pathstr_t aFilePath, const size_t aOffset,
+   if (!aOutFd) {
+     CloseHandle(fd);
+   }
+-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
++#elif defined(HAVE_POSIX_FADVISE) || defined(XP_MACOSX)
+   if (!aFilePath) {
+     if (aOutFd) {
+       *aOutFd = -1;
+diff --git xpcom/io/nsLocalFileUnix.cpp xpcom/io/nsLocalFileUnix.cpp
+index bacf06c..0e46e4a 100644
+--- mozilla/xpcom/io/nsLocalFileUnix.cpp
++++ mozilla/xpcom/io/nsLocalFileUnix.cpp
+@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402220148.s1M1mEhF063064>