Hacker News new | ask | show | jobs
by caf 666 days ago
Making the read side non-blocking doesn't affect the write side, and vice-versa.
1 comments

That is not true for pipes.
It is, at least on Linux for ordinary pipe(2) pipes.

I just wrote up a test to be sure: in the process with the read side, set it to non-blocking with fcntl(p, F_SETFL, O_NONBLOCK) then go to sleep for a long period. Dump a bunch of data into the writing side with the other process: the write() call blocks once the pipe is full as you would expect.