KSH portability

Root Boy Jim rbj at icst-cmr.arpa
Tue May 10 03:20:25 AEST 1988


   From: Doug Gwyn  <gwyn at brl-smoke.arpa>

   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.

Well, it's probably too late in the game for another suggestion (I knew
I should have joined that committee...), but...

What is really needed is an fd to fp table, maintained by stdio, so that:

	for (fd = 0; fd < MAXFD; fd ++)
		fp = fdtofp[fd] && fflush(fp);

Anything weird about this idea?

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

Can't think of anything right now, but my idea is not really peeking, it's
just handle translation.

	(Root Boy) Jim Cottrell	<rbj at icst-cmr.arpa>
	National Bureau of Standards
	Flamer's Hotline: (301) 975-5688
	The opinions expressed are solely my own
	and do not reflect NBS policy or agreement
I HAVE to buy a new ``DODGE MISER'' and two dozen JORDACHE
 JEANS because my viewscreen is ``USER-FRIENDLY''!!



More information about the Comp.unix.wizards mailing list