Date: Mon, 17 Sep 2007 17:20:11 GMT From: Garrett Wollman <wollman@hergotha.csail.mit.edu> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/116413: incorrect getconf(1) handling of unsigned constants gives -1 for ULLONG_MAX Message-ID: <200709171720.l8HHKBYm074948@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/116413; it has been noted by GNATS. From: Garrett Wollman <wollman@hergotha.csail.mit.edu> 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 <mit.lcs.mail.freebsd-bugs/200709170733.l8H7XRmS067276@www.freebsd.org> 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", <value> The description of "%d\n" in XBD6 chapter 5 ("File Format Notation") clearly requires it to output <value> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709171720.l8HHKBYm074948>