uutils/coreutils — pull request #469 by dokaptur (2014-12-09 18:02:53+00:00)
Title: stdbuf - basic version 

My first attempt to solve issue #434

This is very first and basic version of stdbuf working on Linux 86_x64. It assumes that user has GNU coreutils installed (and so libstdbuf.so from GNU in /lib/coreutils). It also works for the same programs GNU stdbuf works, that is programs written in C/C++ using default stdin/stdout/stderr objects from stdio.h library.
To be honest, I don't know how to implement it for programms written in rust.

GNU uses LD_PRELOAD to link dynamically a shared library, which changes stdio.h objects before running the program itself, so buffors are being set properly. I know that rust allows to modify object returned by stdout() in current task by function set_stdout() (http://doc.rust-lang.org/nightly/std/io/stdio/fn.set_stdout.html), but I'm not sure if there is something like this preloading trick for rust.

And other methods that comes to my mind, like forking (spawning) process and buffering stdio from "outside" are useless, as stdbuf is mostly being used to make buffered programms unbuffered. And in this case I can do nothing "from outside".

I'm waiting for code review and some tips how to move it further!