Cygwin 1.7-1 - non-blocking IO problem

Uri Simchoni
Mon Dec 28 13:04:00 GMT 2009


I'm porting an application to Cygwin (1.7-1) and have encountered a problem related to non-blocking IO. It appears that write to a socket blocks in non-blocking mode blocks. I've narrowed it down to the attached program.

The program creates 2 socket pairs, then forks and communicates to the child through these pairs. The parent process writes 1MB then reads 1MB, and repeats that 10 times. The child waits a while, then starts writing 10MB while also reading from the other pair in a non-blocking fashion.
- On Cygwin 1.7-1 it hangs
- If I replace the socketpair() by a pipe() it works (it's possible because I make a uni-directional use with each socket pair).
- It seems that the problem also happens with TCP sockets.
- On Linux it works with the socketpair()
- On Cygwin 1.5.25 it also works (it hanged some of the times but I believe it has to do with my installation)

Please advise.
Uri Simchoni

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: nbtest.c
URL: <>

More information about the Cygwin-developers mailing list