[Patch]: rlogin problems

Pierre A. Humblet pierre@phumblet.no-ip.org
Wed Jun 23 16:26:00 GMT 2004

Warren Young wrote:
> Corinna Vinschen wrote:
> >>      WSASetLastError last.
> >
> > Thanks for this patch!  I've just applied it.  Very weird that this
> > only affected 9x.
> The difference happens because on the Win9x kernels, the Winsock errors
> are kind of a bastard hack-on to the system error subsystem
> (GetLastError() and such).  On WinNT they're integrated, but there are
> still limitations, such as FormatMessage() not working on WSA error
> codes.  With Win2K, WSA errors are totally integrated into the system
> error code scheme.
> So, under Win2K+ and possibly WinNT as well, any system call should
> reset the system error code, as happens with errno on that other class
> of OSes.  That's why you have to set it after the WSACloseEvent() call.

Well, it's kind of the opposite that happened.
On NT the successful WSACloseEvent() didn't affect the WSALastError,
which kept its old value (EINTR).
On 9x the successful WSACloseEvent() did reset WSALastError. rlogin
bailed out when the read failed for no good reason.


More information about the Cygwin-patches mailing list