On Mon, 23 Apr 2007 17:53:39 +0200 Joerg.Schilling at fokus.fraunhofer.de 
(Joerg Schilling) wrote:
> "Josh Hurst" <joshhurst at gmail.com> wrote:

> > > The wrapper is needed in order to make stdio, I/O redirection
> > > and signal handling cooperate with a piece of code that has been
> > > compiled in a standard Solaris environment.
> >
> > What's wrong with using the AST functions and stdio?

> I am not shure what you like to say....

> stdio if no compatible with sfio.

> If the Korn Shell does not use a FILE *std[3] parameter for
> builtin functions (as my bsh does for I/O redirection), then
> ksh93 seems to rely on _overwriting_ stdin/stdout/stderr. 
> This will never work for software that has not the internal knowledge of the
> libc stdio implementation as libc has hidden additional data for stdin/....

ksh can ensure that all sfio streams are flushed before external builtins are 
executed

external builtins are then free to use native stdio on { stdin stdout stderr }
with the proviso that before returning control to ksh
the builtin flushes any of { stdin stdout stderr } that were used
*and* frees all builtin specific memory and resources

a builtin using native stdio would then be treated the same as the builtin
using any resource not known to ksh -- all handling of those resources
is the builtin's responsibility

-- Glenn Fowler -- AT&T Research, Florham Park NJ --


Reply via email to