On Mon, Dec 5, 2016 at 12:57 AM, Martin Kühne <mysat...@gmail.com> wrote: > Sorry if this is completely off the hook now, but if FILE's buffering > is an issue here, can't we just setbuf(NULL)?
This would eliminate the extra copies, but we still have the issue of doing fread repeated reads until the passed in buffer is completely filled before we are able to write anything. Run something like make 2>&1 | cat, and you will see the output only appear in large chunks. I guess my main point with this patch set is, we shouldn't be using the terrible stdio API and suffering from its shortcomings when a plain read and write work just as well if not better...