You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by dg...@hyperreal.org on 1997/12/19 03:16:02 UTC
cvs commit: apachen/src/main conf.h
dgaudet 97/12/18 18:16:02
Modified: src/main conf.h
Log:
Better glibc support for linux.
PR: 1542
Reviewed by: Martin Kraemer, Jim Jagielski
Revision Changes Path
1.163 +30 -2 apachen/src/main/conf.h
Index: conf.h
===================================================================
RCS file: /export/home/cvs/apachen/src/main/conf.h,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -r1.162 -r1.163
--- conf.h 1997/12/01 12:10:14 1.162
+++ conf.h 1997/12/19 02:16:01 1.163
@@ -310,22 +310,50 @@
#define HAVE_SYSLOG
#elif defined(LINUX)
+
#if LINUX > 1
#include <features.h>
+
+/* libc4 systems probably still work, it probably doesn't define
+ * __GNU_LIBRARY__
+ * libc5 systems define __GNU_LIBRARY__ == 1, but don't define __GLIBC__
+ * glibc 2.x and later systems define __GNU_LIBRARY__ == 6, but list it as
+ * "deprecated in favour of __GLIBC__"; the value 6 will never be changed.
+ * glibc 1.x systems (i.e. redhat 4.x on sparc/alpha) should have
+ * __GLIBC__ < 2
+ * all glibc based systems need crypt.h
+ */
#if defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
-/* it's a glibc host */
#include <crypt.h>
-#define NET_SIZE_T size_t
#endif
+
+/* glibc 2.0.0 through 2.0.4 need size_t * here, where 2.0.5 needs socklen_t *
+ * there's no way to discern between these two libraries. But using int should
+ * be portable because otherwise these libs would be hopelessly broken with
+ * reams of existing networking code. We'll use socklen_t * for 2.1.x and
+ * later.
+ *
+ * int works for all the earlier libs, and is picked up by default later.
+ */
+#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 0))
+#define NET_SIZE_T socklen_t
+#endif
+
#define HAVE_SHMGET
#define USE_MMAP_FILES
#define HAVE_SYS_RESOURCE_H
+
+/* glibc 2.1 and later finally define rlim_t */
+#if !defined(__GLIBC__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)
typedef int rlim_t;
+#endif
/* flock is faster ... but hasn't been tested on 1.x systems */
#define USE_FLOCK_SERIALIZED_ACCEPT
+
#else
#define USE_FCNTL_SERIALIZED_ACCEPT
#endif
+
#undef HAVE_GMTOFF
#undef NO_KILLPG
#undef NO_SETSID