Subject: Re: Re: [ksh93-integration-discuss] Verifiying that ksh93 cooperates 
with  plain Solaris libs
--------

> 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/....
> 
> 
> J??
> 

ksh93 does not use the stdio FILE* at all, nor does it use
stdin/stdout,/stderr.  it used sfio which uses Sfio_t*, sfstdin,
sfstdout, and sfstderr.

However, if your builtin uses stdio, you can do one of the following:

1.      compile it with the AST version of stdio.h which maps
        the calls into sfio calls.

2.      compile it natively.  In this case you need to make
        sure that you flush output streams before you return.

In the former case, if the program terminates due to a signal,
files that have been opened with sfopen() will automatically
be closed.  Otherwise, you will have to handle all the cleanup
yourself.

David Korn
dgk at research.att.com

Reply via email to