You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@znep.com> on 1997/12/11 04:42:37 UTC
os-linux/1542: /usr/include/bits/resource.h:113: conflicting types for `rlim_t' (fwd)
I would suggest that the time for automatic rlim_t testing is near.
It is easy to add a "type" test to TestCompile, but the trouble is what
include files do you use? For rlim_t, it should be sys/resource.h
normally but how do you generalize that?
It may be possible to hardcode rlim_t, but we need to know exactly what
version of glibc has it, etc. A pain.
---------- Forwarded message ----------
Date: 10 Dec 1997 16:52:15 -0000
From: Johnie Ingram <jo...@debian.org>
To: apbugs@hyperreal.org
Subject: os-linux/1542: /usr/include/bits/resource.h:113: conflicting types for `rlim_t'
>Number: 1542
>Category: os-linux
>Synopsis: /usr/include/bits/resource.h:113: conflicting types for `rlim_t'
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: apache
>State: open
>Class: sw-bug
>Submitter-Id: apache
>Arrival-Date: Wed Dec 10 10:10:00 PST 1997
>Last-Modified:
>Originator: johnie@debian.org
>Organization:
apache
>Release: 1.3b3
>Environment:
Linux tln 2.0.27 #2 Wed Feb 5 16:01:42 EST 1997 sparc unknown
gcc version egcs-2.90.21 971202 (egcs-1.00 release)
ii libc6 2.0.90-971126- The GNU C library version 2 (run-time files)
>Description:
conf.h:323: previous declaration of `rlim_t'
conf.h:313: typedef int rlim_t
resource.h:113: typedef __rlim_t rlim_t;
resource.h:115: typedef __rlim64_t rlim_t;
>How-To-Repeat:
>Fix:
Do not typdef rlim_t if _sparc_ and __GLIBC__ is define
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <ap...@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED. This is not done]
[automatically because of the potential for mail loops. ]
Re: [PATCH] Re: os-linux/1542: /usr/include/bits/resource.h:113: conflicting types for `rlim_t' (fwd)
Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Wed, Dec 17, 1997 at 04:36:06PM -0500, Jim Jagielski wrote:
>
> Maybe one every Monday, Wednesday and Friday??
>
How about twice a week? Three times a week when release time is nigh?
Martin
--
| S I E M E N S | <Ma...@mch.sni.de> | Siemens Nixdorf
| ------------- | Voice: +49-89-636-46021 | Informationssysteme AG
| N I X D O R F | FAX: +49-89-636-44994 | 81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request
Re: [PATCH] Re: os-linux/1542: /usr/include/bits/resource.h:113: conflicting types for `rlim_t' (fwd)
Posted by Dean Gaudet <dg...@arctic.org>.
No it's not lazy vote time... I just get tired of juggling around more
than half a dozen outstanding patches which still need voting. I lose
track of which of my trees has what in it. That's when I start committing
things that are "innocent". :)
Dean
On Wed, 17 Dec 1997, Martin Kraemer wrote:
> On Mon, Dec 15, 1997 at 11:33:31PM -0800, Dean Gaudet wrote:
> > The following patch is a reasonable attempt to get us -Wall free compiles
> > on 2.0.5 (and later) and 2.1.x glibc.
>
> +1 -- Go ahead, Dean. Seems to be "lazy vote" time again!??!
> I didn't test it myself yet since I don't have all the environments on my
> linux machine. But I have great confidence that you didn't wast your time
> in vain.
>
> Martin
> --
> | S I E M E N S | <Ma...@mch.sni.de> | Siemens Nixdorf
> | ------------- | Voice: +49-89-636-46021 | Informationssysteme AG
> | N I X D O R F | FAX: +49-89-636-44994 | 81730 Munich, Germany
> ~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request
>
Re: [PATCH] Re: os-linux/1542: /usr/include/bits/resource.h:113: conflicting types for `rlim_t' (fwd)
Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Mon, Dec 15, 1997 at 11:33:31PM -0800, Dean Gaudet wrote:
> The following patch is a reasonable attempt to get us -Wall free compiles
> on 2.0.5 (and later) and 2.1.x glibc.
+1 -- Go ahead, Dean. Seems to be "lazy vote" time again!??!
I didn't test it myself yet since I don't have all the environments on my
linux machine. But I have great confidence that you didn't wast your time
in vain.
Martin
--
| S I E M E N S | <Ma...@mch.sni.de> | Siemens Nixdorf
| ------------- | Voice: +49-89-636-46021 | Informationssysteme AG
| N I X D O R F | FAX: +49-89-636-44994 | 81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request
[PATCH] Re: os-linux/1542: /usr/include/bits/resource.h:113: conflicting types for `rlim_t' (fwd)
Posted by Dean Gaudet <dg...@arctic.org>.
On Wed, 10 Dec 1997, Marc Slemko wrote:
> I would suggest that the time for automatic rlim_t testing is near.
>
> It is easy to add a "type" test to TestCompile, but the trouble is what
> include files do you use? For rlim_t, it should be sys/resource.h
> normally but how do you generalize that?
>
> It may be possible to hardcode rlim_t, but we need to know exactly what
> version of glibc has it, etc. A pain.
I spent time looking into this. glibc has a few gotches that are
annoying. I don't think we can support -Wall warning free compilation
on all versions of glibc...
For example, 2.0.0 through 2.0.4 use "size_t *" for the third paramter
to accept() and other network functions, whereas 2.0.5 and later use
"socklen_t *". This is due to evolution of the POSIX spec. (Using size_t
is broken broken broken, and was a hideous mistake in the spec, it breaks
all old programs that assume that paramter is an "int *" when compiled
on 64-bit systems. socklen_t is essentially an int.) However, there is
no way to detect 2.0.x < 2.0.5.
Thankfully rlim_t appears only in glibc 2.1.x, and not earlier.
The following patch is a reasonable attempt to get us -Wall free compiles
on 2.0.5 (and later) and 2.1.x glibc. The rlim_t change is required
to compile on 2.1.x. I've tested on glibc 2.0.5 alpha and ppc systems,
and libc5 i386 systems. The rest I gleaned from looking at various
versions of glibc.
Dean
Index: conf.h
===================================================================
RCS file: /export/home/cvs/apachen/src/main/conf.h,v
retrieving revision 1.162
diff -u -r1.162 conf.h
--- conf.h 1997/12/01 12:10:14 1.162
+++ conf.h 1997/12/16 07:27:14
@@ -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