setlinebuf is on right place now