use O_NONBLOCK only for out end of pipe