aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/transam/xlog.c12
-rw-r--r--src/include/pg_config.h.in4
2 files changed, 11 insertions, 5 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 57a8d1833d8..85618fcf01c 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.239 2006/06/16 04:11:48 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.240 2006/06/18 18:30:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2147,11 +2147,13 @@ XLogFileClose(void)
{
Assert(openLogFile >= 0);
-#ifdef POSIX_FADV_DONTNEED
+#if defined(HAVE_DECL_POSIX_FADVISE) && defined(POSIX_FADV_DONTNEED)
/*
- * WAL caches will not be accessed in the future, so we advise OS to
- * free them. But we will not do so if WAL archiving is active,
- * because archivers might use the caches to read the WAL segment.
+ * WAL segment files will not be re-read in normal operation, so we advise
+ * OS to release any cached pages. But do not do so if WAL archiving is
+ * active, because archiver process could use the cache to read the WAL
+ * segment.
+ *
* While O_DIRECT works for O_SYNC, posix_fadvise() works for fsync()
* and O_SYNC, and some platforms only have posix_fadvise().
*/
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 5ccfbfefd28..82ccde63c1c 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -76,6 +76,10 @@
don't. */
#undef HAVE_DECL_F_FULLFSYNC
+/* Define to 1 if you have the declaration of `posix_fadvise', and to 0 if you
+ don't. */
+#undef HAVE_DECL_POSIX_FADVISE
+
/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
don't. */
#undef HAVE_DECL_SNPRINTF