Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Oct 2000 03:40:02 -0700 (PDT)
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/21948: RLIM_INFINITY definition is apparently wrong
Message-ID:  <200010131040.DAA75338@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/21948; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: jau@iki.fi
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/21948: RLIM_INFINITY definition is apparently wrong
Date: Fri, 13 Oct 2000 21:33:30 +1100 (EST)

 On Thu, 12 Oct 2000 jau@iki.fi wrote:
 
 > >Description:
 > RLIM_INFINITY is currently defined as follows...
 > 
 > #define RLIM_INFINITY   ((rlim_t)(((u_quad_t)1 << 63) - 1))
 > 
 > This is apparently wrong, because using an unsigned quad length
 > integer to represent the value hints that the intended bit pattern
 > to represent infinity is all 64 bits one, 0xFFFFFFFFFFFFFFFF.
 > The current definition makes the pattern anyhow 0x3FFFFFFFFFFFFFFF,
 > which does not require an unsigned type at all.
 
 Actually, the current definition makes the bit pattern 0x7FFFFFFFFFFFFFFF.
 This doesn't require an unsigned type, but one more than it does (on most
 machines), since subtracting one from the value with bit pattern
 0x8000000000000000 would overflow on most machines.
 
 Bruce
 
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200010131040.DAA75338>