RFC: All glibc machine maintainers: Is " RLIM_INFINITY as ((__rlim_t) -1)" OK?

David Miller davem@davemloft.net
Sat May 19 04:39:00 GMT 2012


From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 18 May 2012 19:47:06 -0700

> On Fri, May 18, 2012 at 6:35 PM, Chris Metcalf <cmetcalf@tilera.com> wrote:
>> Note that ((rlim_t) -1) is wrong for RLIM_INFINITY anyway; it would have to
>> be (((rlim_t) -1) >> 1), I think.
>>
> 
> The current one has
> 
> #ifndef __USE_FILE_OFFSET64
> # define RLIM_INFINITY ((unsigned long int)(~0UL))
> #else
> # define RLIM_INFINITY 0xffffffffffffffffuLL
> #endif
> 
> 
> Why ((rlim_t) -1)  is wrong?  BTW, x32 rlim_t is 64-bit.

It looks like, besides sparc, mips and alpha in the glibc-ports tree
also override RLIM_INFINITY to something which is effectively -1 >> 1



More information about the Libc-alpha mailing list