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: utzoo!linus!gatech!seismo!ut-sally!std-unix From: std-unix@ut-sally.UUCP (Moderator, John Quarterman) Newsgroups: mod.std.unix Subject: Re: OPEN_MAX and other constants - are they desireable? Message-ID: <3521@ut-sally.UUCP> Date: Fri, 15-Nov-85 08:10:14 EST Article-I.D.: ut-sally.3521 Posted: Fri Nov 15 08:10:14 1985 Date-Received: Sat, 16-Nov-85 03:47:43 EST References: <3430@ut-sally.UUCP> <3505@ut-sally.UUCP> Organization: IEEE/P1003 Portable Operating System Environment Committee Lines: 36 Approved: jsq@ut-sally.UUCP Date: Thu, 14 Nov 85 17:21:36 pst From: saber!msc@ihnp4.uucp (Mark Callow) > From: Kee Hinckley > > In article <3430@ut-sally.UUCP> you write: > > Date: 06 Oct 85 18:36:07 +1000 (Sun) > > >From: Robert Elz > ... > > I suggest deleting all of the constants, and instead specifying > > a library routine, which when handed a name defined in > > will return the associated constant. > > > > One problem with this is that a piece of code may want to #if off of > particular constants. For instance, if I discover that the amount > of memory I have is too small, and I don't have virtual memory then > I might want to use temporary files. You can do this just as well with an if statement at runtime. Then if someone decides to add more memory to their machine they don't have to recompile their world to take advantage of it. > ...but it would not work out nearly as well if I had to > make that kind of decision at runtime. Why not? The penalty is a small increase in the size of the binary. limits.h and all similar kinds of wired-in constants are the pits. What happens in a network environment? Do your servers have one copy of the program for each client configuration? Of course not. What does a computer manufacturer do? Have a different software release for each system configuration? Of course not. You either end up in the least common denominator trap or you ignore limits.h and implement the library function suggested by kre. Volume-Number: Volume 3, Number 19