i/o redirection

John Nelson john at genrad.UUCP
Thu Apr 18 07:32:50 AEST 1985


In article <215 at ttidca.UUCP> davidt at ttidca.UUCP (David Terlinden) writes:
>gsc asks about buffering of stdout of execed processes.  I say that it's not
>the fault of the OS but of the stdio library.  If the flag field in _iob[1]
>says to buffer output (the default value), the first output function to stdout
>will notice this and allocate a buffer.  Since _iob is initialized data of
>the new process, anything you do before the exec has no effect.  Can anyone
>suggest anything other than modifying "putchar()" or "_iob[]"?

SURE!  Why not write a program to poke around in the executable file, and
reset that flag in _iob[1].  This solves the problem of having only a binary.
Unfortunately, this won't work if the executable has been "stripped".



More information about the Comp.lang.c mailing list