replace some write(fdout, ..) with fdprintf make process invoke system call indirectly