bin/116413: incorrect getconf(1) handling of unsigned constants
gives -1 for ULLONG_MAX
Garrett Wollman
wollman at hergotha.csail.mit.edu
Mon Sep 17 10:20:11 PDT 2007
The following reply was made to PR bin/116413; it has been noted by GNATS.
From: Garrett Wollman <wollman at hergotha.csail.mit.edu>
To: freebsd-gnats-submit at 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 at 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 at 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
More information about the freebsd-bugs
mailing list