Re: RLIM_INFINITY defined twice

Andrey Savochkin (saw@saw.sw.com.sg)
Wed, 28 Jun 2000 11:18:26 +0800


On Tue, Jun 27, 2000 at 02:12:23PM +0200, Ralf Baechle wrote:
> On Thu, Jun 22, 2000 at 08:14:12PM -0500, Bob Gustafson wrote:
>
> > The warning RLIM_INFINITY has come up before (compiling iptables I
> > believe), but this time it caused the failure of a test in configure and
> > the make then failed with the erronious #undef HAVE_RESOURCE_H instead of
> > defining it.
> >
> > There are two resource.h files, one in include/bits and the other in
> > include/asm. They contain two different definitions.
> >
> > Which one should be used?

First of all, your RLIM_INFINITY definition should match the system call you
use. At this moment, there are two versions of getrlimit syscall, one of
them assumes that RLIM_INFINITY == MAX_LONG,
the other that RLIM_INFINITY == MAX_ULONG.
I would prefer the newer syscall with RLIM_INFINITY definition from kernel
(MAX_ULONG).

> Only the libc definitions and never the kernel definitions. With a few
> exceptions applications shouldn't include any definitions from <linux/...>
> or <asm/...>.

Ralf, it may be a surprise for you :-), but glibc-2.0 includes
<asm/resource.h> from its <resourcebits.h>.
Yes, glibc headers conflit with kernel ones very often.
There is a solution other than mentioned by Ralf. Do not include libc
headers.

Best regards
Andrey V.
Savochkin

-
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/