This is the mail archive of the
mailing list for the glibc project.
Re: RFC: All glibc machine maintainers: Is " RLIM_INFINITY as((__rlim_t) -1)" OK?
On Fri, May 18, 2012 at 8:37 PM, David Miller <email@example.com> wrote:
> From: "H.J. Lu" <firstname.lastname@example.org>
> Date: Fri, 18 May 2012 19:47:06 -0700
>> On Fri, May 18, 2012 at 6:35 PM, Chris Metcalf <email@example.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))
>> # define RLIM_INFINITY 0xffffffffffffffffuLL
>> 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
So kernel has
include/asm-generic/resource.h:# define RLIM_INFINITY (~0UL)
and many ports override it. ((rlim_t) -1) is OK then.