aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2001-08-04 19:42:34 +0000
committerBruce Momjian <bruce@momjian.us>2001-08-04 19:42:34 +0000
commit3e51868226be6a012581efa7d92a5992d3fd216d (patch)
tree4855b558bc4cf4e7de7d9cc160e4969b89702d38 /src
parente9ea1255c0d6fc54a34951547061e7e18c1851c8 (diff)
downloadpostgresql-3e51868226be6a012581efa7d92a5992d3fd216d.tar.gz
postgresql-3e51868226be6a012581efa7d92a5992d3fd216d.zip
This patch is because Hurd does not support NOFILE. It is against current
cvs. The Debian bug report says, "The upstream source makes use of NOFILE unconditionalized. As the Hurd doesn't have an arbitrary limit on the number of open files, this is not defined. But _SC_OPEN_MAX works fine and returns 1024 (applications can increase this as they want), so I suggest the below diff. Please forward this upstream, too." Oliver Elphick
Diffstat (limited to 'src')
-rw-r--r--src/backend/storage/file/fd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index b831e6cc241..a696f1fa1fb 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.82 2001/06/18 16:13:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.83 2001/08/04 19:42:34 momjian Exp $
*
* NOTES:
*
@@ -290,8 +290,13 @@ pg_nofile(void)
no_files = sysconf(_SC_OPEN_MAX);
if (no_files == -1)
{
+/* tweak for Hurd, which does not support NOFILE */
+#ifdef NOFILE
elog(DEBUG, "pg_nofile: Unable to get _SC_OPEN_MAX using sysconf(); using %d", NOFILE);
no_files = (long) NOFILE;
+#else
+ elog(FATAL, "pg_nofile: Unable to get _SC_OPEN_MAX using sysconf() and NOFILE is undefined");
+#endif
}
#endif