[PATCH] asm*/resource.h fix for glibc

Jakub Jelinek (jakub@redhat.com)
Thu, 16 Dec 1999 12:21:28 +0100


Hi!

glibc2 up to now includes <asm/resource.h> in bits/resource.h and defines
RLIM_INFINITY later on, so when RLIM_INFINITY moved from linux/resource.h
which glibc2 does not include to asm/resource.h, folks get warning about
redefined RLIM_INFINITY. This will not be a problem with new getrlimit aware
glibc, but with glibc's up to now it is a problem, because e.g. configure
scripts will consider the warning as sign of sys/resource.h not being
present on the system. With the following patch, which defines RLIM_INFINITY
only if asm/resource.h has been included from linux/resource.h, even
non-rlimit-changes aware glibc should continue to work just fine.
Patch against 2.3.33.

--- linux/include/asm-i386/resource.h.jj Thu Dec 9 22:29:05 1999
+++ linux/include/asm-i386/resource.h Thu Dec 16 11:12:17 1999
@@ -22,7 +22,9 @@
* SuS says limits have to be unsigned.
* Which makes a ton more sense anyway.
*/
+#ifdef _LINUX_RESOURCE_H
#define RLIM_INFINITY (~0UL)
+#endif

#ifdef __KERNEL__

--- linux/include/asm-mips/resource.h.jj Thu Dec 9 22:29:06 1999
+++ linux/include/asm-mips/resource.h Thu Dec 16 11:12:50 1999
@@ -29,7 +29,9 @@
* SuS says limits have to be unsigned.
* Which makes a ton more sense anyway.
*/
+#ifdef _LINUX_RESOURCE_H
#define RLIM_INFINITY (~0UL)
+#endif

#ifdef __KERNEL__

--- linux/include/asm-alpha/resource.h.jj Thu Dec 9 22:29:05 1999
+++ linux/include/asm-alpha/resource.h Thu Dec 16 11:11:52 1999
@@ -23,7 +23,9 @@
* we retain the old value for compatibility, especially with DU.
* When you run into the 2^63 barrier, you call me.
*/
+#ifdef _LINUX_RESOURCE_H
#define RLIM_INFINITY 0x7ffffffffffffffful
+#endif

#ifdef __KERNEL__

--- linux/include/asm-m68k/resource.h.jj Thu Dec 9 22:29:06 1999
+++ linux/include/asm-m68k/resource.h Thu Dec 16 11:12:34 1999
@@ -22,7 +22,9 @@
* SuS says limits have to be unsigned.
* Which makes a ton more sense anyway.
*/
+#ifdef _LINUX_RESOURCE_H
#define RLIM_INFINITY (~0UL)
+#endif

#ifdef __KERNEL__

--- linux/include/asm-sparc/resource.h.jj Thu Dec 9 22:29:06 1999
+++ linux/include/asm-sparc/resource.h Thu Dec 16 11:13:26 1999
@@ -28,7 +28,9 @@
* SuS says limits have to be unsigned.
* Which makes a ton more sense anyway.
*/
+#ifdef _LINUX_RESOURCE_H
#define RLIM_INFINITY (~0UL)
+#endif

#ifdef __KERNEL__
#define INIT_RLIMITS \
--- linux/include/asm-ppc/resource.h.jj Thu Dec 9 22:29:06 1999
+++ linux/include/asm-ppc/resource.h Thu Dec 16 11:13:02 1999
@@ -18,8 +18,9 @@
* SuS says limits have to be unsigned.
* Which makes a ton more sense anyway.
*/
+#ifdef _LINUX_RESOURCE_H
#define RLIM_INFINITY (~0UL)
-
+#endif

#ifdef __KERNEL__

--- linux/include/asm-sparc64/resource.h.jj Thu Dec 9 22:29:06 1999
+++ linux/include/asm-sparc64/resource.h Thu Dec 16 11:13:52 1999
@@ -28,7 +28,9 @@
* SuS says limits have to be unsigned.
* Which makes a ton more sense anyway.
*/
+#ifdef _LINUX_RESOURCE_H
#define RLIM_INFINITY (~0UL)
+#endif

#ifdef __KERNEL__
#define INIT_RLIMITS \
@@ -36,7 +38,7 @@
{LONG_MAX, LONG_MAX}, {LONG_MAX, LONG_MAX}, \
{LONG_MAX, LONG_MAX}, {_STK_LIM, LONG_MAX}, \
{ 0, LONG_MAX}, {LONG_MAX, LONG_MAX}, \
- {INR_OPEN, INR_OPEN}, {0, 0}, \
+ {INR_OPEN, INR_OPEN}, {0, 0}, \
{LONG_MAX, LONG_MAX}, {LONG_MAX, LONG_MAX} \
}

--- linux/include/asm-arm/resource.h.jj Thu Dec 9 22:29:05 1999
+++ linux/include/asm-arm/resource.h Thu Dec 16 11:12:02 1999
@@ -22,7 +22,9 @@
* SuS says limits have to be unsigned.
* Which makes a ton more sense anyway.
*/
+#ifdef _LINUX_RESOURCE_H
#define RLIM_INFINITY (~0UL)
+#endif

#ifdef __KERNEL__

--- linux/include/asm-sh/resource.h.jj Thu Dec 9 22:29:06 1999
+++ linux/include/asm-sh/resource.h Thu Dec 16 11:13:13 1999
@@ -22,7 +22,9 @@
* SuS says limits have to be unsigned.
* Which makes a ton more sense anyway.
*/
+#ifdef _LINUX_RESOURCE_H
#define RLIM_INFINITY (~0UL)
+#endif

#ifdef __KERNEL__

Cheers,
Jakub
___________________________________________________________________
Jakub Jelinek | jakub@redhat.com | http://sunsite.mff.cuni.cz/~jj
Linux version 2.3.26 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/