Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Oct 2000 23:22:53 -0700 (PDT)
From:      jau@iki.fi
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/21948: RLIM_INFINITY definition is apparently wrong
Message-ID:  <20001013062253.5CAB437B502@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         21948
>Category:       kern
>Synopsis:       RLIM_INFINITY definition is apparently wrong
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 12 23:30:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Jukka A. Ukkonen
>Release:        3.5.1
>Organization:
SysOpen Ltd. / Finland
>Environment:
FreeBSD mjolnir.thunderbolt.fi 3.5.1-RELEASE FreeBSD 3.5.1-RELEASE #1: Sun Oct  8 20:16:47 EET DST 2000     jau@mjolnir.thunderbolt.fi:/usr/src/sys/compile/Mjolnir  i386

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

>How-To-Repeat:

>Fix:
Either 
#define RLIM_INFINITY   ((rlim_t)((u_quad_t) ~0ULL))
or
#define RLIM_INFINITY   ((rlim_t)(~ (u_quad_t) 0))


>Release-Note:
>Audit-Trail:
>Unformatted:
 X-Send-Pr-Version: www-1.0
 
 


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?20001013062253.5CAB437B502>