From 8eaee81954c6ed59d657f717f991ec379375473c Mon Sep 17 00:00:00 2001
From: Per Cederqvist <ceder@lysator.liu.se>
Date: Fri, 30 Aug 1991 10:00:14 +0000
Subject: [PATCH] Added HAVE_GETDTABLESIZE.

---
 config/balance-config.h  | 27 +++++----------------------
 config/config-template.h | 32 ++++++++++++++++++--------------
 config/sun4os4-config.h  | 13 ++-----------
 3 files changed, 25 insertions(+), 47 deletions(-)

diff --git a/config/balance-config.h b/config/balance-config.h
index 57d5e729d..0be58830f 100644
--- a/config/balance-config.h
+++ b/config/balance-config.h
@@ -1,27 +1,10 @@
 /*
- * $Id: balance-config.h,v 1.1 1991/08/30 01:28:07 ceder Exp $
+ * $Id: balance-config.h,v 1.2 1991/08/30 10:00:14 ceder Exp $
  *
- * This is a generic configuration file for LysKOM.
+ * This works on a Sequent Balance running Dynix 2.1.1.
  */
 
-/*
- * Define BUGGY_INET_NTOA if inet_ntoa is buggy. This is the case for
- * a Sun Sparc with SunOS 4.1.1. If you define BUGGY_INET_NTOA a
- * replacement routine (from libraries/libisc/inet_ntoa.c) will be
- * used.
- */
-
-/* #define BUGGY_INET_NTOA */
-
-/*
- * Max number of file descriptors that can be opened by a process.
- * If this is set too large here, the server will crash when too many
- * people try to connect at the same time.
- */
-
-#define MAX_OPEN_FD 16
-
-/* No LOCALE here.. */
-
-/* #define HAVE_LOCALE */
+/* See config-template.h for comments. */
 
+#define HAVE_GETDTABLESIZE
+#define HAVE_STRERROR
diff --git a/config/config-template.h b/config/config-template.h
index 3a748d30e..7c233421e 100644
--- a/config/config-template.h
+++ b/config/config-template.h
@@ -1,5 +1,5 @@
 /*
- * $Id: config-template.h,v 1.2 1991/08/30 03:37:44 ceder Exp $
+ * $Id: config-template.h,v 1.3 1991/08/30 10:00:13 ceder Exp $
  *
  * This is a generic configuration file for LysKOM.
  */
@@ -14,27 +14,31 @@
 #define BUGGY_INET_NTOA
 
 /*
- * Max number of file descriptors that can be opened by a process.
- * If this is set too large here, the server will crash when too many
- * people try to connect at the same time.
+ * Define HAVE_LOCALE if you have it (and want to use it).
  */
 
-#include <limits.h>
-#ifdef _POSIX_OPEN_MAX
-#define MAX_OPEN_FD _POSIX_OPEN_MAX
-#else
-#define MAX_OPEN_FD 16
-#endif
+#define HAVE_LOCALE
+
+/*
+ * Define HAVE_STRERROR if your libc.a have strerror.
+ */
 
+#define HAVE_STRERROR
 
 /*
- * Define HAVE_LOCALE if you have it (and want to use it).
+ * If you have the getdtablesize system call.
  */
 
-#define HAVE_LOCALE
+#define HAVE_GETDTABLESIZE
 
 /*
- * Define HAVE_STRERROR if your libc.a have strerror.
+ * Max number of file descriptors that can be opened by a process.
+ * If this is set too large here, the server will crash when too many
+ * people try to connect at the same time.
  */
 
-#define HAVE_STRERROR
+#include <sys/param.h>		/* One way to do it... */
+#define MAX_OPEN_FD NOFILE
+
+#include <limits.h>		/* Another. (I'm not sure that this  */
+#define MAX_OPEN_FD _POSIX_OPEN_MAX /* is correct - use at your own risk!*/
diff --git a/config/sun4os4-config.h b/config/sun4os4-config.h
index 6d9c8cbf0..0653c7623 100644
--- a/config/sun4os4-config.h
+++ b/config/sun4os4-config.h
@@ -1,5 +1,5 @@
 /*
- * $Id: sun4os4-config.h,v 1.1 1991/08/30 01:27:59 ceder Exp $
+ * $Id: sun4os4-config.h,v 1.2 1991/08/30 10:00:11 ceder Exp $
  *
  * Configure LysKOM for a Sun Sparc-server running SunOS 4.1.1.
  * This is the configuration we are running at Lysator, so this is
@@ -15,16 +15,7 @@
 
 #define BUGGY_INET_NTOA
 
-/*
- * Max number of file descriptors that can be opened by a process.
- * If this is set too large here, the server will crash when too many
- * people try to connect at the same time.
- *
- * It is possible to boost this value to 256 if you remake the kernel
- * (I think). 58 connections is enough.
- */
-
-#define MAX_OPEN_FD 64
+#define HAVE_GETDTABLESIZE
 
 /* We have LOCALE. */
 
-- 
GitLab