KSH portability

Doug Gwyn gwyn at brl-smoke.ARPA
Sat May 7 05:00:36 AEST 1988


In article <5146 at bloom-beacon.MIT.EDU> wolfgang at mgm.mit.edu (Wolfgang Rupprecht) writes:
>What *is* the "approved" method of finding all _iob's?

There isn't one.  This is an extremely implementation-dependent matter,
subject to change even between C releases for the same system.

The point of using <stdio.h> facilities to to encapsulate I/O streams
as an abstract data type.  If you really need to do something not
supported by the standard interface, you should either avoid using
<stdio.h> facilities or else work to get the standard interface
extended to provide whatever it is that you really need to do.  The
last example of this that I know of is an extension of fflush() so
that a NULL argument indicates a request to flush all open output
streams.  I got this adopted into the proposed ANSI C standard as
probably the last "invention" to make it into the standard (although
I proposed it over a year ago, it got overlooked until last meeting).
Buffer flushing before a fork() has been the only time I have needed
to cheat on the standard interface, and with this change to fflush()
EVENTUALLY that cheat won't be necessary.  Of course it will be a
while before I can rely on fflush() supporting this new feature, so
there will be an #if __STDC__ in the rare places where I need this
capability.

If your need to peek at the FILE implementation differs from this,
I'm curious to hear what it is.



More information about the Comp.unix.questions mailing list