rewrite fdprintf, make it more portable
add printf used for put string into default pipe
replace write() with printf()