From owner-svn-src-all@freebsd.org Fri Oct 21 18:37:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC1D9C1CBF2 for ; Fri, 21 Oct 2016 18:37:54 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 96A86FB9; Fri, 21 Oct 2016 18:37:54 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 5CB93103DA; Fri, 21 Oct 2016 18:37:47 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 770B6439CF; Fri, 21 Oct 2016 20:37:47 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Colin Percival Cc: src-committers@FreeBSD.org, "svn-src-all\@freebsd.org" Subject: Re: cvs commit: src/sys/sys _types.h resource.h References: <200411081805.iA8I5hVK038813@repoman.freebsd.org> <01000157e3ac7982-b19e61c1-1619-44b1-88b5-3080d85e8d6d-000000@email.amazonses.com> Date: Fri, 21 Oct 2016 20:37:47 +0200 In-Reply-To: <01000157e3ac7982-b19e61c1-1619-44b1-88b5-3080d85e8d6d-000000@email.amazonses.com> (Colin Percival's message of "Thu, 20 Oct 2016 19:58:33 +0000") Message-ID: <86wph1o8ec.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 18:37:54 -0000 Colin Percival writes: > Dag-Erling Sm=C3=B8rgrav writes: > > -typedef __int64_t __rlim_t; /* resource limit (XXX not uns= igned) */ > > +typedef __int64_t __rlim_t; /* resource limit - intentiona= lly */ > > + /* signed, because of legacy c= ode */ > > + /* that uses -1 for RLIM_INFIN= ITY */ > Is it time to drop compatibility for code which was "legacy" 12 years ago > in order to conform to the POSIX stipulation that rlim_t should be unsign= ed? Well, all of that code is already broken because I defined RLIM_INFINITY to 2^63-1 instead of 2^64-1. But we might as well align ourselves with the legacy code (and with other OSes), as the consequences of changing RLIM_INFINITY are mostly cosmetic: an older ulimit on a newer kernel (or the other way around) will print a very large number instead of "unlimited", and if an older binary sets a limit to RLIM_INFINITY on a newer kernel (or the other way around) the kernel will spend a little extra time checking limits which will never be reached anyway. This will allow us to eliminate a certain amount of code (e.g. in procfs and the Linuxulator) that translates back and forth between our current RLIMIT_INFINITY and (int64_t)-1 / ~0UL. DES -- Dag-Erling Sm=C3=B8rgrav - des@des.no