Article View: mod.std.unix
Article #30Limits that can stay in limits.h
From: Moderator, John Quarterman
Date: Sat, 16 Nov 1985 00:38
Date: Sat, 16 Nov 1985 00:38
38 lines
2300 bytes
2300 bytes
Date: Fri, 15 Nov 85 11:49:49 EST
From: Dan Franklin <dan@BBN-PROPHET.ARPA>
While we're moving kernel-dependent values out of limits.h into a system call
where they belong, it seems only appropriate to list the limits which I believe
are appropriate for limits.h, and should stay there.
{CHAR_BIT} Maximum number of bits in a datum of type char
{CHAR_MAX} Maximum magnitude for a datum of type char
{CHAR_MIN} Minimum magnitude for a datum of type char
{INT_MAX} (Same for ints)
{INT_MIN}
{LONG_MAX} (For longs)
{LONG_MIN}
{SHRT_MAX} (For shorts)
{SHRT_MIN}
{USI_MAX} (For unsigned ints)
{WORD_BIT} Number of bits in a word or datum of type int
These limits reflect the architecture of the CPU as viewed through the
compiler; they would change only if the CPU architecture or the compiler
changed. They can safely be kept in limits.h because if the architecture
changed, recompilation would be necessary for other reasons besides getting the
value of the limit to be up-to-date; and if the compiler changed, recompilation
wouldn't be necessary because the operation of binaries is not affected by
changes to the compiler (except perhaps binaries that actually deal with
compiler output, like symbol tables and .o files and so on; again, such
binaries would need a lot more than just an up-to-date value or two).
It's also inappropriate (as well as unnecessary) for the kernel to return these
values, since they are not properties of the kernel like {PIPE_MAX}.
By the way, why aren't there USL_MAX, USC_MAX, and USS_MAX? (For unsigned
longs, chars, and shorts respectively.)
Dan
Volume-Number: Volume 3, Number 22
Technical Details
Message-ID:
<3531@ut-sally.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!linus!gatech!seismo!ut-sally!std-unixShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ut-sally.UUCP Path: arc1-ca.pugleaf.net!utzoo!linus!gatech!seismo!ut-sally!std-unix From: std-unix@ut-sally.UUCP (Moderator, John Quarterman) Newsgroups: mod.std.unix Subject: Limits that can stay in limits.h Message-ID: <3531@ut-sally.UUCP> Date: Fri, 15-Nov-85 19:38:17 EST Article-I.D.: ut-sally.3531 Posted: Fri Nov 15 19:38:17 1985 Date-Received: Sat, 16-Nov-85 03:57:45 EST Organization: IEEE/P1003 Portable Operating System Environment Committee Lines: 38 Approved: jsq@ut-sally.UUCP