From owner-freebsd-bugs@FreeBSD.ORG Mon Sep 17 17:20:11 2007 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F32B16A418 for ; Mon, 17 Sep 2007 17:20:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6309313C478 for ; Mon, 17 Sep 2007 17:20:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8HHKBB0074949 for ; Mon, 17 Sep 2007 17:20:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8HHKBYm074948; Mon, 17 Sep 2007 17:20:11 GMT (envelope-from gnats) Date: Mon, 17 Sep 2007 17:20:11 GMT Message-Id: <200709171720.l8HHKBYm074948@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Garrett Wollman Cc: Subject: Re: bin/116413: incorrect getconf(1) handling of unsigned constants gives -1 for ULLONG_MAX X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Garrett Wollman List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2007 17:20:11 -0000 The following reply was made to PR bin/116413; it has been noted by GNATS. From: Garrett Wollman To: freebsd-gnats-submit@freebsd.org Cc: Subject: Re: bin/116413: incorrect getconf(1) handling of unsigned constants gives -1 for ULLONG_MAX Date: Mon, 17 Sep 2007 12:45:14 -0400 (EDT) In article you write: >The code /usr/src/usr.bin/getconf/limits.gperf doesn't correctly handle >unsigned constants. It is not clear to me that the POSIX specification allows it to "correctly handle unsigned constants". XCU6 page 516 lines 18634ff: Otherwise, if the specified variable is defined on the system, its value shall be written in the following format: "%d\n", The description of "%d\n" in XBD6 chapter 5 ("File Format Notation") clearly requires it to output as a signed integer. This fits with the definition of the sysconf() function as returning a signed long. Having said that, supporting these non-sysconf() limits such as these is a FreeBSD extension and we need not be bound by POSIX when (and only when) querying non-POSIX values. -GAWollman -- Garrett A. Wollman | The real tragedy of human existence is not that we are wollman@csail.mit.edu| nasty by nature, but that a cruel structural asymmetry Opinions not those | grants to rare events of meanness such power to shape of MIT or CSAIL. | our history. - S.J. Gould, Ten Thousand Acts of Kindness