EINTR vs. WSAEINTR
wine-devel at shemesh.biz
Sun Sep 5 09:15:37 CDT 2004
When calling "select" (or any other socket function, for that purpose),
there is a chance that a signal will arrive while we are blocking on the
socket. This will cause the blocking function to return with EINTR. The
usual recommendation is to retry the operation if that is the case.
Our current behavior, at least in "WS_select", is to convert it to
WSAEINTR, and return the error. I think this behavior is wrong.
MSDN says that WSAEINTR is only returned if WSACancelBlockingCall is
received during the wait. I have a program for which I can affect the
source that fails because of a select call being interrupted. I'm
wondering whether it's better to fix the program to retry on WSAEINTR,
or to fix wine. One possible fix to Wine is to mask all signals right
before calling "select", and restore the signal mask when returning.
This will ensure that EINTR will not be received.
Can someone more versed in winsock voice an opinion about whether this
is indeed a problem in Wine?
More information about the wine-devel