Subject: Re: Re: Re: [ksh93-integration-discuss] Verifiying that ksh93
cooperates with plain Solaris libs
--------
> I suspect that this will not work at all as you need to overwrite
> stdin/stdout/stderr in case you like to implement I/O redirection without
> passing FILE* std[3]. As stdio has hidden data that is not inside FILE *,
> you would only overwrite parts of the stdio data.
>
>
I would not pass FILE* std[3]. You would just use file descriptor 0-3.
You could just do
std[0]=stdin;
std[1]=stdout;
std[2]=stderr;
in your code rather than passing them down. When I invoked a non-standard
builtin, I always flush the sfio buffers so that you should be
able to use the file descripors and set up FILE streams corresponding to them.
Similarly, when you are done, you would just flush stdin, stdout, and
stderr, so that the output would be written and the seek pointers
would be set appropriately and then sfio could use these descriptors.
David Korn
dgk at research.att.com