Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: stdio on SYSV vrs BSD Message-ID: <3290@auspex.auspex.com> Date: 2 May 90 21:25:44 GMT References: <558@venice.SEDD.TRW.COM> <1990May2.045800.25928@kfw.COM> Organization: Auspex Systems, Santa Clara Lines: 20 >> What is the equivalent on SYSV machines? > >I hope to God there isn't one. Uhh, System V's hack is worse; it sets the file descriptor number for a "this is really a string" stream to _NFILE, and it *does* do some special-casing in "_doscan". The problem with this is that it *hard-codes* the idea that _NFILE is the number of file descriptors into standard I/O, which sucks because the maximum number of file descriptors is tunable in later S5 releases. Choosing some far out-of-range value such as 255 on unsigned-char machines and -1 on signed-char machines would have been preferable.... (Yes, I know that S5's standard I/O has a fixed number of "_iob" entries, and thus couldn't use the extra descriptors anyway. This is *not* a valid excuse; 4.3BSD's standard I/O dynamically allocates the "_iob" stuff, and those techniques could be applied to S5's as well - definitely so if binary compatibility isn't a concern, and it may be possible even if it *is* a concern.)