This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch]: rlogin problems


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]