I wrote a code in C/C++ which forks a child process, duplicates the stdin/stdout into a pipe ends and calls execvp.
Everything is working fine (i.e. the output from
http://lists.gnu.org/archive/html/bug-coreutils/2008-11/msg00164.html
you can use LD_PRELOAD to setvbuf